/**
 * @file display.c
 * @author taylor peng
 * @brief 没有特别说明一般只适用于黑白屏或双色屏
 * @version 0.1
 * @date 2021-12-27
 * 
 * @copyright Copyright (c) 2021
 * 
 */
#include "display.h"
#include "WORD_LIB.H"
#include "system.h"
#include "prj_conf.h"
#include "lcd_hal.h"
#include "func_mem.h"
#include "device.h"

static const uint8_t *Battery_List[]=
{
    BATTERY_EMPTY,
    BATTERY_ONE,
    BATTERY_TWO,
    BATTERY_THREE,
    BATTERY_FULL
};


#define StringLen(x)    sizeof(x) / sizeof(unsigned char*)

static System_Timer *g_LCD_point = NULL;

static const unsigned char *TITLE_WELCOME[] = {CN_HUAN_12, CN_YIN_12, CN_SHI2_12, CN_YONG_12}; //欢迎使用


static const unsigned char *IDENTIFYFAIL_CHN[] = {CH_YAN_ZM, CH_ZHENG_ZM, CH_SHI_ZM, CH_BAI_ZM}; //验证失败
static const unsigned char *IDENTIFYSUCESS_CHN[] = {CH_YAN_ZM, CH_ZHENG_ZM, CH_CHENG_ZM, CH_GONG_ZM}; //验证成功
static const unsigned char *INPUT_FINGER_CHN[] = {CH_QING_ZM, CH_FANG_ZM, CH_SHOU_ZM, CH_ZHI_ZM}; //请放手指
#ifdef FUNC_SUPPORT_FACE
static const unsigned char *FACE_CAMERA_CHN[] = {CH_QING_ZM, CH_ZHENG1_ZM, CH_DUI_ZM, CH_SHE1_ZM, CH_XIANG2_ZM, CH_TOU_ZM}; //请正对摄像头
static const unsigned char *FACE_UP_CHN[] = {CH_QING_ZM, CH_XIANG1_ZM, CH_SHANG_ZM, CH_WEI1_ZM, CH_WEI1_ZM, CH_TAI_ZM, CH_TOU_ZM}; //请向上微微抬头
static const unsigned char *FACE_DOWN_CHN[] = {CH_QING_ZM, CH_XIANG1_ZM, CH_XIA_ZM, CH_WEI1_ZM, CH_WEI1_ZM, CH_DI_ZM, CH_TOU_ZM}; //请向下微微低头
static const unsigned char *FACE_LEFT_CHN[] = {CH_QING_ZM, CH_XIANG1_ZM, CH_ZUO1_ZM, CH_WEI1_ZM, CH_WEI1_ZM, CH_ZHUAN_ZM, CH_TOU_ZM}; //请向左微微转头
static const unsigned char *FACE_RIGHT_CHN[] = {CH_QING_ZM, CH_XIANG1_ZM, CH_YOU_ZM, CH_WEI1_ZM, CH_WEI1_ZM, CH_ZHUAN_ZM, CH_TOU_ZM}; //请向右微微转头
static const unsigned char *NO_FACE_CHN[] = {CH_WU_ZM, CH_MIAN_ZM, CH_BU_ZM, CH_XIN1_ZM, CH_XI1_ZM}; //无面部信息
static const unsigned char *FACEFULL_CHN[] = {CH_MIAN_ZM, CH_BU_ZM, CH_XIN1_ZM, CH_XI1_ZM,  CH_YI_ZM, CH_MAN_ZM}; //面部信息已满
static const unsigned char *ADD_FACE_CHN[] = {CH_TIAN_ZM, CH_JIA_ZM, CH_MIAN_ZM, CH_BU_ZM, CH_XIN1_ZM, CH_XI1_ZM};//添加面部信息
static const unsigned char *ADD_PASSWORD_FINGER_CARD_CHN[] = {CH_TIAN_ZM, CH_JIA_ZM, CH_ZHI_ZM, CH_WEN_ZM, CH_MI_ZM, CH_MA_ZM, CH_KA_ZM};//添加指纹密码卡
static const unsigned char *DELETE_FACE_CHN[] = {CH_SHAN_ZM, CH_CHU1_ZM, CH_MIAN_ZM, CH_BU_ZM, CH_XIN1_ZM, CH_XI1_ZM};//删除面部信息
static const unsigned char *DELETE_PASSWORD_FINGER_CARD_CHN[] = {CH_SHAN_ZM, CH_CHU1_ZM, CH_ZHI_ZM, CH_WEN_ZM, CH_MI_ZM, CH_MA_ZM, CH_KA_ZM};//删除指纹密码卡
static const unsigned char *DELETE_COMMON_FACES_CHN[] = {CH_QING1_ZM, CH_KONG_ZM, CH_MIAN_ZM, CH_BU_ZM, CH_XIN1_ZM, CH_XI1_ZM};//清空人脸
static const unsigned char *FACE_SENSITIVITY_CHN[] = {CH_MIAN_ZM, CH_BU_ZM, CH_SHI4_ZM, CH_BIE_ZM, CH_LING_ZM, CH_MIN_ZM, CH_DU_ZM};//人脸灵敏度调整
static const unsigned char *HIGH_CHN[] = {CH_GAO_ZM};
static const unsigned char *MIDDLE_CHN[] = {CH_ZHONG_ZM};
static const unsigned char *LOW_CHN[] = {CH_DI_ZM};
static const unsigned char *FACE_CHN[] = {CH_REN1_ZM, CH_LIAN_ZM};
#endif
static const unsigned char *INPUT_CARD_CHN[] = {CH_QING_ZM, CH_SHUA_ZM, CH_KA_ZM}; //请刷卡
static const unsigned char *INPUTMANAGE_CHN[] = {CH_QING_ZM, CH_YAN_ZM, CH_ZHENG_ZM, CH_GUAN1_ZM, CH_LI_ZM, CH_YONG_ZM, CH_HU_ZM};
static const unsigned char *INPUT_ADMIN_PASSWORD_CHN[] = {CH_QING_ZM, CH_XIU_ZM, CH_GAI_ZM, CH_GUAN1_ZM, CH_LI_ZM, CH_MI_ZM, CH_MA_ZM}; //请修改管理密码
static const unsigned char *SET_ADMIN_PASSWORD_CHN[] = {CH_QING_ZM, CH_SHE_ZM, CH_ZHI1_ZM, CH_GUAN1_ZM, CH_LI_ZM, CH_MI_ZM, CH_MA_ZM}; //请设置管理密码
static const unsigned char *INPUT_PASSWORD_AGAIN_CHN[] = {CH_QING_ZM, CH_ZAI_ZM, CH_SHU_ZM, CH_RU_ZM, CH_YI2_ZM, CH_CI_ZM}; //请再输入一次
static const unsigned char *CAN_BE_ADD_CHN[] = {CH_KE_ZM, CH_TIAN_ZM, CH_JIA_ZM, CH_YONG_ZM, CH_HU_ZM}; //可添加用户
static const unsigned char *CAN_BE_DELETE_CHN[] = {CH_KE_ZM, CH_SHAN_ZM, CH_CHU1_ZM, CH_YONG_ZM, CH_HU_ZM}; //可删除用户
static const unsigned char *OR_INPUT_UID_CHN[] = {CH_HUO_ZM, CH_SHU_ZM, CH_RU_ZM, CH_BIAN_ZM, CH_HAO_ZM, CH_SHAN_ZM, CH_CHU1_ZM}; //或输入编号
static const unsigned char *FINGER_CHN[] = {CH_ZHI_ZM, CH_WEN_ZM}; //指纹
static const unsigned char *PASSWORD_CHN[] = {CH_MI_ZM, CH_MA_ZM}; //密码
static const unsigned char *TEMP_PASSWORD_CHN[] = {CH_LIN_ZM, CH_SHI1_ZM, CH_MI_ZM, CH_MA_ZM}; //密码
static const unsigned char *CARD_CHN[] = {CH_KA_ZM}; //卡
static const unsigned char *NO_FINGER_CHN[] = {CH_WU_ZM, CH_ZHI_ZM, CH_WEN_ZM}; //无指纹
static const unsigned char *NO_PASSWORD_CHN[] = {CH_WU_ZM, CH_MI_ZM, CH_MA_ZM}; //无密码
static const unsigned char *NO_CARD_CHN[] = {CH_WU_ZM, CH_KA_ZM}; //无卡

static const unsigned char *INVALID_CHN[] = {CH_FEI_ZM, CH_FA_ZM, CH_CAO_ZM, CH_ZUO_ZM}; //非法操作
static const unsigned char *SYSLOCK_CHN[] = {CH_XI_ZM, CH_TONG1_ZM, CH_SUO_ZM, CH_DING_ZM}; //系统已锁定
static const unsigned char *FINGER_LOCK_CHN[] = {CH_ZHI_ZM, CH_WEN_ZM, CH_SUO_ZM, CH_DING_ZM}; //指纹锁定
static const unsigned char *KEY_LOCK_CHN[] = {CH_AN_ZM, CH_JIAN2_ZM, CH_SUO_ZM, CH_DING_ZM}; //按键锁定
static const unsigned char *CARD_LOCK_CHN[] = {CH_KA_ZM, CH_SUO_ZM, CH_DING_ZM}; //卡锁定
static const unsigned char *LOCK_TIME_CHN[] = {CH_SUO_ZM, CH_DING_ZM, CH_SHI1_ZM, CH_JIAN_ZM}; //锁定时间
static const unsigned char *SECOND_TIME_CHN[] = {CH_MIAO_ZM}; //秒
static const unsigned char *USERFULL_CHN[] = {CH_CUN_ZM, CH_LIANG_ZM, CH_YI_ZM, CH_MAN_ZM}; //用户已满
static const unsigned char *NOUSER_CHN[] = {CH_WU_ZM, CH_KE_ZM, CH_SHAN_ZM, CH_CHU1_ZM, CH_YONG_ZM, CH_HU_ZM}; //无可删除用户
static const unsigned char *FINGERFULL_CHN[] = {CH_ZHI_ZM, CH_WEN_ZM, CH_YI_ZM, CH_MAN_ZM}; //指纹已满
static const unsigned char *USEREXIST_CHN[] = {CH_YONG_ZM, CH_HU_ZM, CH_YI_ZM, CH_CUN_ZM, CH_ZAI1_ZM}; //用户已存在
static const unsigned char *MOVE_FINGER_CHN[] = {CH_QING_ZM, CH_YI1_ZM, CH_KAI_ZM, CH_SHOU_ZM, CH_ZHI_ZM}; //请移开手指
static const unsigned char *PUT_AGAIN_CHN[] = {CH_ZAI_ZM, CH_FANG_ZM, CH_YI2_ZM, CH_CI_ZM}; //再放一次

static const unsigned char *CARDFULL_CHN[] = {CH_KA_ZM, CH_YI_ZM, CH_MAN_ZM}; //卡已满
static const unsigned char *PASSWORD_FULL_CHN[] = {CH_MI_ZM, CH_MA_ZM, CH_YI_ZM, CH_MAN_ZM}; //密码已满
static const unsigned char *PASSWORD_EASY_CHN[] = {CH_MI_ZM, CH_MA_ZM, CH_GUO_ZM, CH_YU1_ZM, CH_JIAN1_ZM, CH_DAN_ZM}; //密码过于简单
static const unsigned char *DOUBLE_IDENTIFY_CHN[] = {CH_QING_ZM, CH_JIN_ZM, CH_XING_ZM, CH_SHUANG_ZM, CH_CHONG_ZM, CH_YAN_ZM, CH_ZHENG_ZM}; //密码过于简单
static const unsigned char *ADDFAIL_CHN[] = {CH_TIAN_ZM, CH_JIA_ZM, CH_SHI_ZM, CH_BAI_ZM}; //添加失败
static const unsigned char *ADDSUCCESS_CHN[] = {CH_TIAN_ZM, CH_JIA_ZM, CH_CHENG_ZM, CH_GONG_ZM}; //添加成功
static const unsigned char *OPERAFAIL_CHN[] = {CH_CAO_ZM, CH_ZUO_ZM, CH_SHI_ZM, CH_BAI_ZM}; //操作失败
static const unsigned char *OPERASUCCESS_CHN[] = {CH_CAO_ZM, CH_ZUO_ZM, CH_CHENG_ZM, CH_GONG_ZM}; //操作成功
static const unsigned char *ENCRYPTING_CHN[] = {CH_JIA_ZM, CH_MI_ZM, CH_ZHONG_ZM}; //加密中
static const unsigned char *DELETE_FAIL_CHN[] = {CH_SHAN_ZM, CH_CHU1_ZM, CH_SHI_ZM, CH_BAI_ZM}; //删除失败

static const unsigned char *SET_SUCCESS_CHN[] = {CH_SHE_ZM, CH_ZHI1_ZM, CH_CHENG_ZM, CH_GONG_ZM}; //设置成功
static const unsigned char *SET_FAIL_CHN[] = {CH_SHE_ZM, CH_ZHI1_ZM, CH_SHI_ZM, CH_BAI_ZM}; //设置失败

static const unsigned char *DELETE_SUCCESS_CHN[] = {CH_SHAN_ZM, CH_CHU1_ZM, CH_CHENG_ZM, CH_GONG_ZM}; //删除成功
static const unsigned char *WAIT_CHN[] = {CH_QING_ZM, CH_SHAO_ZM, CH_HOU_ZM}; //请稍后
static const unsigned char *ALWAYS_ON_CHN[] = {CH_CHANG_ZM, CH_KAI_ZM, CH_YI_ZM, CH_DA_ZM, CH_KAI_ZM}; //常开已打开
static const unsigned char *SINGLEMODE_CHN[] = {CH_DAN_ZM, CH_KAI_ZM, CH_MU_ZM, CH_SHI2_ZM}; //单开模式
static const unsigned char *DOUBLEMODE_CHN[] = {CH_SHUANG_ZM, CH_KAI_ZM, CH_MU_ZM, CH_SHI2_ZM}; //双开模式
static const unsigned char *NONERECORD_CHN[] = {CH_WU_ZM, CH_JI_ZM, CH_LU_ZM};

static const unsigned char *INSURE_CHN[] = {CH_QUE_ZM, CH_REN_ZM};//确认
static const unsigned char *CANCLE_CHN[] = {CH_QU_ZM, CH_XIAO_ZM};//取消

static const unsigned char *UNLOCK_CHN[] = {CH_SUO_ZM, CH_YI_ZM, CH_KAI_ZM};
static const unsigned char *LOCK_CHN[] = {CH_SUO_ZM, CH_YI_ZM, CH_GUAN_ZM};
static const unsigned char *UNLOCKING_CHN[] = {CH_KAI_ZM, CH_SUO_ZM, CH_ZHONG_ZM};
static const unsigned char *LOCKING_CHN[] = {CH_GUAN_ZM, CH_SUO_ZM, CH_ZHONG_ZM};

static const unsigned char *INPUT_PARAM_CHN[] = {CH_QING_ZM, CH_XUAN_ZM, CH_ZE_ZM, CH_CAN_ZM, CH_SHU1_ZM};
static const unsigned char *CLOSE_CHN[] = {CH_GUAN_ZM, CH_BI_ZM};

static const unsigned char *ADD_COMMON_USER_CHN[] = {CH_TIAN_ZM, CH_JIA_ZM, CH_PU_ZM, CH_TONG_ZM, CH_YONG_ZM, CH_HU_ZM}; //添加普通用户
static const unsigned char *DELETE_SINGLE_USER_CHN[] = {CH_SHAN_ZM, CH_CHU1_ZM, CH_PU_ZM, CH_TONG_ZM, CH_YONG_ZM, CH_HU_ZM}; //删除单个用户
static const unsigned char *CHANGE_ADMIN_PASSWORD_CHN[] = {CH_XIU_ZM, CH_GAI_ZM, CH_GUAN1_ZM, CH_LI_ZM, CH_MI_ZM, CH_MA_ZM};//修改管理密码
static const unsigned char *ADD_ADMIN_FINGER_CHN[] = {CH_TIAN_ZM, CH_JIA_ZM, CH_GUAN1_ZM, CH_LI_ZM, CH_ZHI_ZM, CH_WEN_ZM}; //添加管理指纹
static const unsigned char *CHANGE_ADMIN_FINGER_CHN[] = {CH_XIU_ZM, CH_GAI_ZM, CH_GUAN1_ZM, CH_LI_ZM, CH_ZHI_ZM, CH_WEN_ZM}; //修改管理指纹
static const unsigned char *DELETE_USERS_CHN[] = {CH_QING1_ZM, CH_KONG_ZM, CH_PU_ZM, CH_TONG_ZM, CH_YONG_ZM, CH_HU_ZM}; //清空普通用户
static const unsigned char *SYSTEM_SETTING_CHN[] = {CH_XI_ZM, CH_TONG1_ZM, CH_SHE_ZM, CH_ZHI1_ZM}; //系统设置
static const unsigned char *INSTALLATION_PARAM_CHN[] = {CH_AN1_ZM, CH_ZHUANG1_ZM, CH_SHE_ZM, CH_ZHI1_ZM};
static const unsigned char *MOTOR_NET_CONFIG_CHN[] = {CH_WANG_ZM, CH_LUO_ZM, CH_SHE_ZM, CH_ZHI1_ZM};

static const unsigned char *DELETE_COMMON_PASSWORDS_CHN[] = {CH_QING1_ZM, CH_KONG_ZM, CH_PU_ZM, CH_TONG_ZM, CH_MI_ZM, CH_MA_ZM};//清空普通密码
static const unsigned char *DELETE_COMMON_FINGERS_CHN[] = {CH_QING1_ZM, CH_KONG_ZM, CH_PU_ZM, CH_TONG_ZM, CH_ZHI_ZM, CH_WEN_ZM};//清空普通指纹
static const unsigned char *DELETE_COMMON_CARDS_CHN[] = {CH_QING1_ZM, CH_KONG_ZM, CH_KA_ZM, CH_PIAN_ZM};//清空卡片

static const unsigned char *OPEN_DOUBLE_MODE_CHN[] = {CH_KAI_ZM, CH_QI_ZM, CH_SHUANG_ZM, CH_CHONG_ZM, CH_YAN_ZM, CH_ZHENG_ZM};//开启双重验证
static const unsigned char *CLOSE_DOUBLE_MODE_CHN[] = {CH_GUAN_ZM, CH_BI_ZM, CH_SHUANG_ZM, CH_CHONG_ZM, CH_YAN_ZM, CH_ZHENG_ZM};//关闭双重验证
static const unsigned char *OEPN_ALWAYS_ON_CHN[] = {CH_KAI_ZM, CH_QI_ZM, CH_CHANG_ZM, CH_KAI_ZM, CH_MU_ZM, CH_SHI2_ZM};//开启常开模式
static const unsigned char *CLOSE_ALWAYS_ON_CHN[] = {CH_GUAN_ZM, CH_BI_ZM, CH_CHANG_ZM, CH_KAI_ZM, CH_MU_ZM, CH_SHI2_ZM};//关闭常开模式
static const unsigned char *FACTORY_RESET_CHN[] = {CH_HUI_ZM, CH_FU_ZM, CH_CHU_ZM, CH_CHANG1_ZM, CH_SHE_ZM, CH_ZHI1_ZM};//恢复出厂设置
static const unsigned char *FACTORY_RESET_SUCESS_CHN[] = {CH_HUI_ZM, CH_FU_ZM, CH_CHU_ZM, CH_CHANG1_ZM, CH_SHE_ZM, CH_ZHI1_ZM, CH_CHENG_ZM, CH_GONG_ZM};//恢复出厂设置成功
static const unsigned char *VOICE_MODE_CHN[] = {CH_YU_ZM, CH_YIN_ZM, CH_MU_ZM, CH_SHI2_ZM};//语音模式
static const unsigned char *SILENT_MODE_CHN[] = {CH_JING_ZM, CH_YIN_ZM, CH_MU_ZM, CH_SHI2_ZM};//静音模式
static const unsigned char *OPEN_ALARM_MODE_CHN[] = {CH_KAI_ZM, CH_QI_ZM, CH_FANG1_ZM, CH_QIAO_ZM};//开启防撬
static const unsigned char *CLOSE_ALARM_MODE_CHN[] = {CH_GUAN_ZM, CH_BI_ZM, CH_FANG1_ZM, CH_QIAO_ZM};//关闭防撬
static const unsigned char *CHANGE_ENG_CHN[] = {CH_YING_ZM, CH_WEN1_ZM};//英文
static const unsigned char *TIME_SETTING_CHN[] = {CH_SHI1_ZM, CH_JIAN_ZM, CH_SHE_ZM, CH_ZHI1_ZM};//时间设置
static const unsigned char *VIEW_RECORD_CHN[] = {CH_JI_ZM, CH_LU_ZM, CH_CHA_ZM, CH_XUN_ZM};//记录查询
static const unsigned char *USER_ID_CHN[] = {CH_BIAN_ZM, CH_HAO_ZM};//用户编号

const unsigned char  *OPTION_TAB[] = {CH_CAO_ZM, CH_ZUO_ZM};//操作
const unsigned char  *USER_TYPE_TAB[] = {CH_LEI_ZM, CH_XING1_ZM};//类型
const unsigned char  *CMD_OPEN_TAB[] = {CH_KAI_ZM, CH_MEN_ZM, CH_CAO_ZM, CH_ZUO_ZM};//开门操作
const unsigned char  *CMD_REST_TAB[] = {CH_FU_ZM, CH_WEI_ZM, CH_XI_ZM, CH_TONG_ZM};//复位系统
const unsigned char  *CMD_DELETE_TAB[] = {CH_SHAN_ZM, CH_CHU1_ZM, CH_YONG_ZM, CH_HU_ZM};//删除用户
const unsigned char  *CMD_CLEAR_TAB[] = {CH_QING1_ZM, CH_KONG_ZM, CH_YONG_ZM, CH_HU_ZM};//清空用户
const unsigned char  *CMD_ADD_TAB[] = {CH_TIAN_ZM, CH_JIA_ZM, CH_YONG_ZM, CH_HU_ZM};//增加用户
const unsigned char  *CMD_CHANGE_TAB[] = {CH_XIU_ZM, CH_GAI_ZM, CH_YONG_ZM, CH_HU_ZM};//修改用户
const unsigned char  *CMD_ALARM_TAB[] = {CH_BAO_ZM, CH_JING1_ZM};//修改用户
const unsigned char  *CMD_SET_TAB[] = {CH_SHE_ZM, CH_ZHI1_ZM, CH_XI_ZM, CH_TONG_ZM};//设置系统
const unsigned char  *CMD_INIT_TAB[] = {CH_CHU_ZM, CH_CHANG1_ZM, CH_SHE_ZM, CH_ZHI1_ZM};//出厂设置
const unsigned char  *CMD_DAMAGE_TAB[] = {CH_FANG1_ZM, CH_QIAO_ZM, CH_BAO_ZM, CH_JING1_ZM};//防撬报警
const unsigned char  *CMD_LOWBAT_TAB[] = {CH_DI_ZM, CH_DIAN_ZM, CH_LIANG_ZM, CH_BAO_ZM, CH_JING1_ZM};//低电量报警

const unsigned char  *DIRECTION_SET_CHN[] = {CH_QIE_ZM, CH_HUAN_ZM,CH_KAI_ZM, CH_MEN_ZM, CH_FANG2_ZM, CH_XIANG1_ZM};//电机方向
const unsigned char  *MOTOR_LEFT_CHN[] = {CH_ZUO1_ZM,CH_KAI_ZM, CH_MEN_ZM};//左开门
const unsigned char  *MOTOR_RIGHT_CHN[] = {CH_YOU_ZM,CH_KAI_ZM, CH_MEN_ZM};//右开门
const unsigned char  *DRIVE_LEVEL_CHN[] = {CH_SHE_ZM, CH_ZHI1_ZM, CH_NIU_ZM, CH_LI1_ZM, CH_DENG_ZM, CH_JI1_ZM};//扭力等级
const unsigned char  *WAIT_BACK_TIME_CHN[] = {CH_SHE_ZM, CH_ZHI1_ZM, CH_HUI1_ZM, CH_SUO_ZM, CH_SHI1_ZM, CH_JIAN_ZM};//回锁时间
const unsigned char  *AUTO_CLOSE_TIME_CHN[] = {CH_SHE_ZM, CH_ZHI1_ZM, CH_YAN1_ZM, CH_SHI1_ZM, CH_SHANG_ZM, CH_SUO_ZM};//延迟上锁
const unsigned char  *BACK_DRIVE_TIME_CHN[] = {CH_FAN_ZM, CH_ZHUAN_ZM, CH_SHI1_ZM, CH_JIAN_ZM};//反转时间

const unsigned char  *JOIN_NET_CHN[] = {CH_JIA_ZM, CH_RU_ZM,CH_WANG_ZM, CH_LUO_ZM};
const unsigned char  *EXIT_NET_CHN[] = {CH_TUI_ZM, CH_CHU_ZM,CH_WANG_ZM, CH_LUO_ZM};

static const char ADD_COMMON_USER_ENG[] = "Common User";
static const char DELETE_SINGLE_USER_ENG[] = "Delete User";
static const char CHANGE_ADMIN_PASSWORD_ENG[] = "Admin PWD";
static const char ADD_ADMIN_FINGER_ENG[] = "Admin Finger";
static const char DELETE_USERS_ENG[] = "Delete Users";
static const char SYSTEM_SETTING_ENG[] = "System Set";
static const char INSTALLATION_PARAM_ENG[] = "Installation";
static const char MOTOR_NET_CONFIG_ENG[] = "Net Config";
#ifdef FUNC_SUPPORT_FACE
static const char ADD_FACE_ENG[] = "Add Face ID";
static const char PASSWORD_FINGER_CARD_ENG[] = "FP Card PWD";
static const char DELETE_FACE_ENG[] = "Delete Face ID";

static const char DELETE_COMMON_FACE_ENG[] = "Delete Face";
static const char FACE_SENSITIVITY_ENG[] = "Face Distance";

#endif
static const char DELETE_COMMON_PASSWORDS_ENG[] = "Delete PWD";
static const char DELETE_COMMON_FINGERS_ENG[] = "Delete Finger";
static const char DELETE_COMMON_CARDS_ENG[] = "Delete Card";

static const char DIRECTION_SET_ENG[] = "Change Dir";
static const char MOTOR_LEFT_ENG[] = "Motor Left";
static const char MOTOR_RIGHT_ENG[] = "Motor right";
static const char ENABLE_AUTO_CLOSE_ENG[] = "AutoMode On";
static const char AUTO_CLOSE_TIME_ENG[] = "Close Time";
static const char DRIVE_LEVEL_ENG[] = "Drive Level";
static const char WAIT_BACK_TIME_ENG[] = "Wait Time";
static const char BACK_DRIVE_TIME_ENG[] = "Back Run";

static const char JOIN_NET_ENG[] = "Join Net";
static const char EXIT_NET_ENG[] = "Exit Net";

static const char OPEN_DOUBLE_MODE_ENG[] = "Double Mode";
static const char CLOSE_DOUBLE_MODE_ENG[] = "Single Mode";
static const char OEPN_ALWAYS_ON_ENG[] = "Always Unlock";
static const char CLOSE_ALWAYS_ON_ENG[] = "Cancle Always";
static const char FACTORY_RESET_ENG[] = "Factory Reset";
static const char VOICE_MODE_ENG[] = "Audio Mode";
static const char SILENT_MODE_ENG[] = "Silent Mode";
static const char OPEN_ALARM_MODE_ENG[] = "Open Alarm";
static const char CLOSE_ALARM_MODE_ENG[] = "Close Alarm";
static const char CHINESE_ENG[] = "Chinese";
static const char TIME_SETTING_ENG[] = "Time Setting";
static const char VIEW_RECORD_ENG[] = "View Record";

static const unsigned char **MENU_FIRST_CHN[] =
{
    CHANGE_ADMIN_PASSWORD_CHN,
    ADD_ADMIN_FINGER_CHN,
    ADD_COMMON_USER_CHN,
    DELETE_SINGLE_USER_CHN,
    DELETE_USERS_CHN,
    SYSTEM_SETTING_CHN,
    INSTALLATION_PARAM_CHN,
#ifdef     WIFI_MODULE
    MOTOR_NET_CONFIG_CHN,
#endif
};

static const char *MENU_FIRST_ENG[] =
{
    CHANGE_ADMIN_PASSWORD_ENG,
    ADD_ADMIN_FINGER_ENG,
    ADD_COMMON_USER_ENG,
    DELETE_SINGLE_USER_ENG,
    DELETE_USERS_ENG,
    SYSTEM_SETTING_ENG,
    INSTALLATION_PARAM_ENG,
#ifdef     WIFI_MODULE
    MOTOR_NET_CONFIG_ENG,
#endif
};
static const unsigned char Menu_List_First[] = {
    StringLen(ADD_COMMON_USER_CHN),
    StringLen(DELETE_SINGLE_USER_CHN),
    StringLen(CHANGE_ADMIN_PASSWORD_CHN),
    StringLen(ADD_ADMIN_FINGER_CHN),
    StringLen(DELETE_USERS_CHN),
    StringLen(SYSTEM_SETTING_CHN),
    StringLen(INSTALLATION_PARAM_CHN),
#ifdef     WIFI_MODULE
    StringLen(MOTOR_NET_CONFIG_CHN),
#endif
};
#ifdef FUNC_SUPPORT_FACE
static const unsigned char **MENU_ADD_USER_CHN[] =
{
    ADD_FACE_CHN,
    ADD_PASSWORD_FINGER_CARD_CHN,
};

static const char *MENU_ADD_USER_ENG[] =
{
    ADD_FACE_ENG,
    PASSWORD_FINGER_CARD_ENG,
};

static const unsigned char Menu_List_Add_User[] =
{
    StringLen(ADD_FACE_CHN),
    StringLen(ADD_PASSWORD_FINGER_CARD_CHN),
};

static const unsigned char **MENU_DELETE_SINGLE_USER_CHN[] =
{
    DELETE_FACE_CHN,
    DELETE_PASSWORD_FINGER_CARD_CHN,
};

static const char *MENU_DELETE_SINGLE_USER_ENG[] =
{
    DELETE_FACE_ENG,
    PASSWORD_FINGER_CARD_ENG,
};

static const unsigned char Menu_Delete_Single_User[] =
{
    StringLen(DELETE_FACE_CHN),
    StringLen(DELETE_PASSWORD_FINGER_CARD_CHN),
};
static const unsigned char **FACE_SENSITIVITY_SELECT_CHN[] =
{
    CLOSE_CHN,
    LOW_CHN,
    MIDDLE_CHN,
    HIGH_CHN,
};

static char *FACE_SENSITIVITY_SELECT_ENG[]=
{
    "Close"
    "Low",
    "Middle",
    "High",
};

static const unsigned char Face_Sensitivity_List[] = {
    StringLen(CLOSE_CHN),
    StringLen(LOW_CHN),
    StringLen(MIDDLE_CHN),
    StringLen(HIGH_CHN),
};
#endif
static const unsigned char **MENU_DELETES_CHN[] =
{
    DELETE_COMMON_PASSWORDS_CHN,
    DELETE_COMMON_FINGERS_CHN,
    DELETE_COMMON_CARDS_CHN,
#ifdef FUNC_SUPPORT_FACE
    DELETE_COMMON_FACES_CHN,
#endif
};
static const char *MENU_DELETES_ENG[] =
{
    DELETE_COMMON_PASSWORDS_ENG,
    DELETE_COMMON_FINGERS_ENG,
    DELETE_COMMON_CARDS_ENG,
#ifdef FUNC_SUPPORT_FACE
    DELETE_COMMON_FACE_ENG,
#endif
};
static const unsigned char Menu_List_Delete[] = {
    StringLen(DELETE_COMMON_PASSWORDS_CHN),
    StringLen(DELETE_COMMON_FINGERS_CHN),
    StringLen(DELETE_COMMON_CARDS_CHN),
#ifdef FUNC_SUPPORT_FACE
    StringLen(DELETE_COMMON_FACES_CHN),
#endif
};

static const unsigned char **MENU_SYSTEM_SETTING_CHN[] =
{
    OPEN_DOUBLE_MODE_CHN,
    FACTORY_RESET_CHN,
    VOICE_MODE_CHN,
    OPEN_ALARM_MODE_CHN,
    TIME_SETTING_CHN,
    #if defined(OPENDOOR_RECORD) || defined(ALL_KINDS_RECORD)
    VIEW_RECORD_CHN,
    #endif
    #ifdef    FUNC_SUPPORT_ENG
    CHANGE_ENG_CHN,
    #endif
};

static const char *MENU_SYSTEM_SETTING_ENG[]=
{
    OPEN_DOUBLE_MODE_ENG,
    FACTORY_RESET_ENG,
    VOICE_MODE_ENG,
    OPEN_ALARM_MODE_ENG,
    TIME_SETTING_ENG,
    #if defined(OPENDOOR_RECORD) || defined(ALL_KINDS_RECORD)
    VIEW_RECORD_ENG,
    #endif
    #ifdef    FUNC_SUPPORT_ENG
    CHINESE_ENG,
    #endif
};

static const unsigned char Menu_List_System_Setting[] = {
    StringLen(OPEN_DOUBLE_MODE_CHN),
    StringLen(FACTORY_RESET_CHN),
    StringLen(VOICE_MODE_CHN),
    StringLen(OPEN_ALARM_MODE_CHN),
    StringLen(TIME_SETTING_CHN),
    #if defined(OPENDOOR_RECORD) || defined(ALL_KINDS_RECORD)
    StringLen(VIEW_RECORD_CHN),
    #endif
    #ifdef    FUNC_SUPPORT_ENG
    StringLen(CHANGE_ENG_CHN),
    #endif
};

static const unsigned char **MENU_INSTALL_PARAM_SET_CHN[] =
{
    MOTOR_LEFT_CHN,
    DRIVE_LEVEL_CHN,
    WAIT_BACK_TIME_CHN,
    AUTO_CLOSE_TIME_CHN,
    BACK_DRIVE_TIME_CHN,
#ifdef FUNC_SUPPORT_FACE
    FACE_SENSITIVITY_CHN,
#endif
};

static const char *MENU_INSTALL_PARAM_SET_ENG[]=
{
    DIRECTION_SET_ENG,
    DRIVE_LEVEL_ENG,
    WAIT_BACK_TIME_ENG,
    AUTO_CLOSE_TIME_ENG,
    BACK_DRIVE_TIME_ENG,
#ifdef FUNC_SUPPORT_FACE
    FACE_SENSITIVITY_ENG,
#endif
};

static const unsigned char Menu_List_Install_Param[] = {
    StringLen(MOTOR_LEFT_CHN),
    StringLen(DRIVE_LEVEL_CHN),
    StringLen(WAIT_BACK_TIME_CHN),
    StringLen(AUTO_CLOSE_TIME_CHN),
    StringLen(BACK_DRIVE_TIME_CHN),
#ifdef FUNC_SUPPORT_FACE
    StringLen(FACE_SENSITIVITY_CHN),
#endif
};

static const unsigned char **MENU_NET_CONFIG_CHN[] =
{
    JOIN_NET_CHN,
    EXIT_NET_CHN,
};
static const char *MENU_NET_CONFIG_ENG[]=
{
    JOIN_NET_ENG,
    EXIT_NET_ENG,
};

static const unsigned char Menu_List_Net_Config[] = {
    StringLen(JOIN_NET_CHN),
    StringLen(EXIT_NET_CHN),
};

static const unsigned char **RECORD_OPERATE_CHN[] =
{
    CMD_OPEN_TAB,
    NULL,
    CMD_ADD_TAB,
    CMD_DELETE_TAB,
    CMD_CLEAR_TAB,
    CMD_CHANGE_TAB,
    CMD_ALARM_TAB,
    CMD_REST_TAB,
    CMD_SET_TAB,
    CMD_INIT_TAB,
};

static char *RECORD_OPERATE_ENG[] =
{
    "Open",
    NULL,
    "Add",
    "Delete",
    "Clear",
    "Change",
    "Alarm",
    "Reset",
    "Setting",
    "Init",
};

static const unsigned char Menu_List_RECORD_OPERATE[] = {
    StringLen(CMD_OPEN_TAB),
    0,
    StringLen(CMD_ADD_TAB),
    StringLen(CMD_DELETE_TAB),
    StringLen(CMD_CLEAR_TAB),
    StringLen(CMD_CHANGE_TAB),
    StringLen(CMD_ALARM_TAB),
    StringLen(CMD_REST_TAB),
    StringLen(CMD_SET_TAB),
    StringLen(CMD_INIT_TAB),
};

static const unsigned char **RECORD_TYPE_CHN[] =
{
    PASSWORD_CHN,
    FINGER_CHN,
    CARD_CHN,
    TEMP_PASSWORD_CHN,
    KEY_LOCK_CHN,
    FINGER_LOCK_CHN,
    CARD_LOCK_CHN,
    SYSLOCK_CHN,
    CMD_DAMAGE_TAB,
    CMD_LOWBAT_TAB,
#ifdef FUNC_SUPPORT_FACE
    FACE_CHN,
#endif
};

static char *RECORD_TYPE_ENG[]=
{
    "PWD",
    "Finger",
    "Card",
    "Temp",
    "KeyLock",
    "FpLock",
    "CardLock",
    "SysLock",
    "Break",
    "LowBat",
#ifdef FUNC_SUPPORT_FACE
    "Face",
#endif
};

static const unsigned char Menu_List_RECORD_TYPE[] = {
    StringLen(PASSWORD_CHN),
    StringLen(FINGER_CHN),
    StringLen(CARD_CHN),
    StringLen(TEMP_PASSWORD_CHN),
    StringLen(KEY_LOCK_CHN),
    StringLen(FINGER_LOCK_CHN),
    StringLen(CARD_LOCK_CHN),
    StringLen(SYSLOCK_CHN),
    StringLen(CMD_DAMAGE_TAB),
    StringLen(CMD_LOWBAT_TAB),
#ifdef FUNC_SUPPORT_FACE
    StringLen(FACE_CHN),
#endif
};


/***********************************************************************
**函数名:Fill_AllBuff
**功能:清除所有显存
**参数:无
**返回值:无
**备注:
***********************************************************************/
static void Fill_AllBuff(uint8_t (*OLED_Block)[MAX_COLUMN], uint8_t data)
{
    uint8_t page, column;
    if (OLED_Block)
    {
        for (page = 0; page < MAX_PAGES; page++)
        {
            for (column = 0; column < MAX_COLUMN; column++)
            {
                OLED_Block[page][column] = data;
            }
        }
    }
}

/***********************************************************************
**函数名:Clear_AllBuff
**功能:清除所有显存
**参数:无
**返回值:无
**备注:
***********************************************************************/
static void Clear_AllBuff(uint8_t (*OLED_Block)[MAX_COLUMN])
{
    Fill_AllBuff(OLED_Block, 0);
}
/***********************************************************************
**函数名:Disp_Word16x16_CHN
**功能:显示16x16汉字
**参数:
		* data_p 汉字
		page 页位置
		start_x 开始位置
		type 0 正常显示 ，1 反显
**返回值:无
**备注:
***********************************************************************/
static void  Disp_Word16x16_CHN(uint8_t (*OLED_Block)[MAX_COLUMN], uint8_t const *data_p, uint8_t page, uint8_t start_x, uint8_t type)
{
    uint8_t i, r, coun;
    if (OLED_Block)
    {
        if (page + 1u >= MAX_PAGES)
        {
            return;
        }
        if (start_x + 16u > MAX_COLUMN)
        {
            return;
        }
        for (r = 0; r < LINE_BASE; r++)
        {
            coun = start_x;
            for (i = 0; i < ROW_BASE * 2; i++)
            {
                if (type)
                {
                    OLED_Block[page][coun] = (~*data_p);
                }
                else
                {
                    OLED_Block[page][coun] = *data_p;
                }
                data_p++;
                coun++;
            }
            page++;
        }
    }
}

/***********************************************************************
**函数名:Disp_Word8x16_ENG
**功能:显示8x16的英文字母
**参数:
		data 要显示的字母
		page 页位置
		start_x 开始位置
		type 0 正常显示 ，1 反显
**返回值:无
**备注:
***********************************************************************/
static void  Disp_Word8x16_ENG(uint8_t (*OLED_Block)[MAX_COLUMN], unsigned char data, uint8_t page, uint8_t start_x, uint8_t type)
{
    unsigned char i;
    if (OLED_Block)
    {
        if (start_x + 8 > MAX_COLUMN)
        {
            return;
        }

        if (page + 1 >= MAX_PAGES)
        {
            return;
        }

        if (data < ASCII_SPACE)
        {
            return;
        }

        if (data >= 0x80)
        {
            return;
        }
        data -= ASCII_SPACE;
        for (i = 0; i < 16; i++)
        {
            if (type)
            {
                OLED_Block[page][start_x] = ~(ENG_8x16[data][i]);
            }
            else
            {
                OLED_Block[page][start_x] = ENG_8x16[data][i];
            }
            start_x++;
            if (i == 7)
            {
                start_x -= 8;
                page++;
            }
        }
    }
}
/***********************************************************************
**函数名:Disp_String8x16_ENG2
**功能:显示英文字符串
**参数:
		**data_p 字符串信息
		page 页位置
		start_x 开始位置
		type 0 正常显示 ，1 反显
**返回值:无
**备注:
***********************************************************************/
static void Disp_String8x16_ENG(uint8_t (*OLED_Block)[MAX_COLUMN], char *data_p, unsigned char page, unsigned char start_x, unsigned char type)
{
    unsigned char data;
    if (OLED_Block)
    {
        do
        {
            data = *data_p;
            if (data == ASCII_NULL)
            {
                break;
            }
            else
            {
                Disp_Word8x16_ENG(OLED_Block, data, page, start_x, type);
                data_p++;
                start_x += 8;
            }
        }while (1);
    }
}
/***********************************************************************
**函数名:Disp_Word12x12_CHN
**功能:显示12x12汉字
**参数:
		* data_p 汉字
		page 页位置
		start_x 开始位置
**返回值:无
**备注:   Disp_Word12x12_CHN(CH_RI_ZM,   page, x_coor, 0);
***********************************************************************/
static void  Disp_Word12x12_CHN(uint8_t (*OLED_Block)[MAX_COLUMN], const unsigned char * data_p, unsigned char  page, unsigned char const start_x)
{
    unsigned char i, r, coun;
    if (OLED_Block)
    {
        if (page + 1 >= 8)
        {
            return;
        }
        if (start_x + 12 > MAX_COLUMN)
        {
            return;
        }

        for (r = 0; r < 2; r++)     //汉字两个8位  两行
        {
            coun = start_x;
            for (i = 0; i < 12; i++) //16个点
            {
                OLED_Block[page][coun] = *data_p;
                data_p++;
                coun++;
            }
            page++;
        }
    }
}

/***********************************************************************
**函数名:Disp_String12x12_CHN
**功能:显示12x12的中文字符串
**参数:
		**data_p 字符串信息
		page 页位置
		start_x 开始位置
		bytes 个数
**返回值:无
**备注:
***********************************************************************/
static void Disp_String12x12_CHN(uint8_t (*OLED_Block)[MAX_COLUMN], const unsigned char **data_p, unsigned char page, unsigned char start_x, unsigned char bytes)
{
    unsigned char i;

    for (i = 0; i < bytes; i++)
    {
        Disp_Word12x12_CHN(OLED_Block, *data_p,  page, start_x);
        data_p++;
        start_x += 12;
    }
}

/***********************************************************************
**函数名:Cursor_Set
**功能:显示光标
**参数:
		page 页位置
		column 行位置
		lines 列位置
**返回值:无
**备注:
***********************************************************************/
static void Cursor_Set(uint8_t (*OLED_Block)[MAX_COLUMN], uint8_t page, uint8_t column, uint8_t lines)
{
    static uint8_t tim = 0;
    if (OLED_Block)
    {
        if (tim < 10u)
        {
            if (lines == 2u)
            {
                OLED_Block[page][column] = 0xFE;
                OLED_Block[page + 1u][column] = 0x7F;
            }
            else
            {
                OLED_Block[page][column] = 0x7E;
            }
        }
        else if (tim > 20u)
        {
            tim = 0;
        }
        tim++;
    }
}



static void Disp_String16x16_CHN(uint8_t (*OLED_Block)[MAX_COLUMN], unsigned char const **data_p, unsigned char page, unsigned char start_x, unsigned char bytes, unsigned char type)
{
    unsigned char i;

    for (i = 0; i < bytes; i++)
    {
        Disp_Word16x16_CHN(OLED_Block, *data_p, page, start_x, type);
        data_p++;
        start_x += 16;
    }
}


/***********************************************************************
**函数名:Disp_LineNum
**功能:显示加下划线
**参数:
		page 页位置
		start_x 开始位置
		bytes 个数
		type 0 正常显示 ，1 反显
**返回值:无
**备注:
***********************************************************************/
static void Disp_LineNum(uint8_t (*OLED_Block)[MAX_COLUMN], uint8_t page, uint8_t start_x, uint8_t type)
{
    uint8_t i;
    if (OLED_Block)
    {
        if (start_x + 8u > MAX_COLUMN)
        {
            return;
        }

        if (page + 1u >= MAX_PAGES)
        {
            return;
        }


        for (i = 0; i < ROW_BASE * 2; i++)
        {
            if (i > ROW_BASE)
            {
                if (type)
                {
                    OLED_Block[page][start_x] = OLED_Block[page][start_x] | ~LINE_NUM;
                }
                else
                {
                    OLED_Block[page][start_x] = OLED_Block[page][start_x] | LINE_NUM;
                }
            }
            start_x++;
            if (i == 7u)
            {
                start_x -= 8u;
                page++;
            }
        }
    }
}

/***********************************************************************
**函数名:Disp_Num
**功能:显示1-9数字
**参数:
		num 显示数字
		page 页位置
		start_x 开始位置
		bytes 个数
		type 0 正常显示 ，1 反显
**返回值:无
**备注:
***********************************************************************/
static void Disp_Num(uint8_t (*OLED_Block)[MAX_COLUMN], unsigned char num, uint8_t page, uint8_t start_x, uint8_t type)
{
    Disp_Word8x16_ENG(OLED_Block, num + '0', page, start_x, type);
}
/***********************************************************************
**函数名:Disp_UID
**功能:显示3位用户编号
**参数:
		num 显示数字
		page 页位置
		start_x 开始位置
		type 0 正常显示 ，1 反显
**返回值:无
**备注:只能显示3位，超过需要根据应用重新修改函数
***********************************************************************/

static void Disp_UID(uint8_t (*OLED_Block)[MAX_COLUMN], uint16_t num, uint8_t page, uint8_t start_x, uint8_t type)
{
    if (num < 999)
    {
        Disp_Num(OLED_Block, num / 100, page, start_x, type);
        Disp_Num(OLED_Block, (num / 10)%10, page, start_x + ROW_BASE, type);
        Disp_Num(OLED_Block, num % 10, page, start_x + ROW_BASE * 2, type);
    }
}

static void Disp_Flush(uint8_t (*OLED_Block)[MAX_COLUMN], uint16_t num, uint8_t u8line, uint8_t u8st)
{
    Disp_Num(OLED_Block, num / 10000, u8line, START_ONE + u8st, FALSE);
    Disp_Num(OLED_Block, (num / 1000) % 10, u8line, START_TWO + u8st, FALSE);
    Disp_Num(OLED_Block, (num / 100) % 10, u8line, START_THREE + u8st, FALSE);
    Disp_Num(OLED_Block, (num / 10) % 10, u8line, START_FOUR + u8st, FALSE);
    Disp_Num(OLED_Block, num % 10, u8line, START_FIVE + u8st, FALSE);
}


static void Disp_Bat(uint8_t (*OLED_Block)[MAX_COLUMN], uint8_t Level)
{
    uint8_t i;
    if (OLED_Block)
    {
        if (Level <= BAT_LEVEL5)
        {
            for (i = 0; i < 16; i++)
            {
                OLED_Block[0][START_FOURTEEN + i] = (Battery_List[Level][16 + i] << 4) | (Battery_List[Level][i] >> 4);
                OLED_Block[1][START_FOURTEEN + i] = Battery_List[Level][16 + i] >> 4;
            }
        }
    }
}

static void Disp_Line(uint8_t (*OLED_Block)[MAX_COLUMN])
{
    unsigned char j;
    if (OLED_Block)
    {
        for (j = 0; j < LOGO_MAX_WIDTH; j++)
        {
            OLED_Block[PAGE_CEN][j] |= LINE_IDLE;
        }
    }
}

static void Disp_Logo(uint8_t (*OLED_Block)[MAX_COLUMN])
{
    unsigned char i, j;
    if (OLED_Block)
    {
        if (LANGUAUE_ENG == Func_Mem_Getsystem_Langue())
        {
            Disp_String8x16_ENG(OLED_Block,"Smart Lock", PAGE_MIDLE, START_FOUR, FALSE);
        }
        else if (LANGUAUE_CHN == Func_Mem_Getsystem_Langue())
        {
            for (i = 0; i < 3; i++)
            {
                for (j = 0; j < 64; j++)
                {
                    OLED_Block[PAGE_TWO + i + 1][j + START_FIVE] = CHN_LOGO[i * 64 + j];
                }
            }
        }
    }
}
static void Disp_Logo_Custom(uint8_t type, uint8_t (*OLED_Block)[MAX_COLUMN], void *ptr)
{
    uint8_t x;
    uint8_t y;
    uint8_t start_x;
    uint8_t start_y;
    uint8_t *data;

    MemLogo_stu_t *m_logo;
    m_logo = ptr;
    if (OLED_Block && m_logo)
    {
        data = m_logo->data;
        start_x = (LOGO_MAX_WIDTH - m_logo->width) >> 1;
        switch (m_logo->high)
        {
            case LOGO_FOUR_PAGE:
                start_y = PAGE_TWO;
                break;
            case LOGO_FIVE_PAGE:
                start_y = PAGE_CEN;
                break;
            case LOGO_SIX_PAGE:
                start_y = PAGE_ONE;
                break;
            case LOGO_FULL_PAGE:
                start_y = PAGE_ONE;
                break;
            default:
                start_y = PAGE_ONE;
                break;
        }
        x = m_logo->width;
        y = m_logo->high >> 3;
        for (uint8_t u8y = 0; u8y < y; u8y++)
        {
            for (uint8_t u8i = 0; u8i < x; u8i++)
            {
                OLED_Block[start_y + u8y][start_x + u8i] = *data++;
            }
        }
    }
}

static void Disp_MenuChn_List(uint8_t (*OLED_Block)[MAX_COLUMN], uint8_t index, uint8_t max, const uint8_t ***Menulist, uint8_t const *ptr)
{
    uint8_t i;
    uint8_t start = 0;
    uint8_t flg = FALSE;
    uint8_t end;
    if (index > 3)
    {
        start = index - 3;
    }
    if (max < 4)
    {
        end = max;
    }
    else
    {
        end = 4;
    }
    for (i = start; i < end + start; i++)
    {
        if (index == i)
        {
            flg = TRUE;
        }
        else
        {
            flg = FALSE;
        }
        if (i >= 9)
        {
            Disp_String16x16_CHN(OLED_Block, Menulist[i], PAGE_BASE * (i-start), START_THREE, ptr[i], flg);
        }
        else
        {
            Disp_String16x16_CHN(OLED_Block, Menulist[i], PAGE_BASE * (i - start), START_THREE, ptr[i], flg);
        }
    }
}

static void Disp_MenuEng_List(uint8_t (*OLED_Block)[MAX_COLUMN], uint8_t index, uint8_t max, char **Menulist)
{
    uint8_t i;
    uint8_t start = 0;
    uint8_t flg = FALSE;
    uint8_t end;
    if (index > 3)
        start = index - 3;
    if (max < 4)
        end = max;
    else
        end = 4;
    for (i = start; i < end + start; i++)
    {
        if (index == i)
        {
            flg = TRUE;
        }
        else
        {
            flg = FALSE;
        }
        if (i >= 9)
        {
            Disp_String8x16_ENG(OLED_Block,Menulist[i], PAGE_BASE * (i - start), START_THREE, flg);
        }
        else
        {
            Disp_String8x16_ENG(OLED_Block,Menulist[i], PAGE_BASE * (i - start), START_THREE, flg);
        }
    }
}

//欢迎使用
static void Disp_TitleWelcome(uint8_t (*OLED_Block)[MAX_COLUMN])
{
    if (LANGUAUE_ENG == Func_Mem_Getsystem_Langue())
    {
        Disp_String8x16_ENG(OLED_Block, "Welcome", PAGE_ONE, START_ONE, FALSE);
    }
    else if (LANGUAUE_CHN == Func_Mem_Getsystem_Langue())
    {
        Disp_String12x12_CHN(OLED_Block, TITLE_WELCOME, PAGE_ONE, START_ONE, sizeof(TITLE_WELCOME) / sizeof(uint8_t*));
    }
}

static void Disp_Password_num(uint8_t (*OLED_Block)[MAX_COLUMN], uint8_t *pw, uint8_t len, uint8_t page, uint8_t flg)
{
    uint8_t i;
    for (i = 0; i < len; i++)
    {
        if (i < 12)
        {
            if (pw)
            {
                Disp_Word8x16_ENG(OLED_Block, pw[i], page, START_BASE * i, FALSE);
            }
            else
            {
                Disp_Word8x16_ENG(OLED_Block, ASCII_STAR,page,START_BASE*i, FALSE);
            }
        }
        else
        {
            break;
        }
    }
    if ((i < 12) && (flg == TRUE)) //闪烁下滑线
    {
        Disp_Word8x16_ENG(OLED_Block, ASCII_BOTTOMLINE, page, START_BASE * i, FALSE);
    }
}


static void Disp_Input_UserInfo(uint8_t flg, const uint8_t ***words, char *eng, uint8_t *lenbuf)
{
    uint8_t oledbuff[MAX_PAGES][MAX_COLUMN];
    uint8_t i, start = START_ONE;
    Clear_AllBuff(oledbuff);
    if (LANGUAUE_ENG == Func_Mem_Getsystem_Langue())
    {
        if (flg)
        {
            Disp_String8x16_ENG(oledbuff, "Can Be Add", PAGE_ONE, START_ONE, FALSE);
        }
        else
        {
            Disp_String8x16_ENG(oledbuff, "Can Be Delete", PAGE_ONE, START_ONE, FALSE);
            //Disp_String8x16_ENG(oledbuff, "Or UID", PAGE_THREE, START_ONE, FALSE);
        }
        Disp_String8x16_ENG(oledbuff, eng, PAGE_TWO, START_ONE, FALSE);
    }
    else if (LANGUAUE_CHN == Func_Mem_Getsystem_Langue())
    {
        if (flg)
        {
            Disp_String16x16_CHN(oledbuff, CAN_BE_ADD_CHN, PAGE_ONE, START_ONE, StringLen(CAN_BE_ADD_CHN), FALSE);
        }
        else
        {
            Disp_String16x16_CHN(oledbuff, CAN_BE_DELETE_CHN, PAGE_ONE, START_ONE, StringLen(CAN_BE_DELETE_CHN), FALSE);
            //Disp_String16x16_CHN(oledbuff, OR_INPUT_UID_CHN, PAGE_THREE, START_ONE, StringLen(CAN_BE_DELETE_CHN), FALSE);
        }

        for (i = 0; i < 3; i++)
        {
            if (0 == lenbuf[i])
            {
                break;
            }
            Disp_String16x16_CHN(oledbuff, words[i], PAGE_TWO, start, lenbuf[i], FALSE);
            start += 2 * START_BASE * lenbuf[i] + START_BASE;
        }
    }
    Fill_AllBlock(oledbuff);
}

/***********************************************************************
**函数名:Disp_Sucess_UID
**功能:成功显示编号
**参数:
**返回值:无
**备注:
***********************************************************************/
static void Disp_Sucess_UID(uint8_t type, uint16_t uid, unsigned char const **words, uint8_t len)
{
    uint8_t oledbuff[MAX_PAGES][MAX_COLUMN];
    Clear_AllBuff(oledbuff);

    if (LANGUAUE_ENG == Func_Mem_Getsystem_Langue())
    {
        if (type)
        {
            Disp_String8x16_ENG(oledbuff, "Succeeded", PAGE_TWO, START_FOUR, FALSE);
            Disp_String8x16_ENG(oledbuff, "  UID", PAGE_THREE, START_THREE, FALSE);
        }
        else
        {
            Disp_String8x16_ENG(oledbuff, "Succeeded", PAGE_MIDLE, START_FOUR, FALSE);
        }
    }
    else if (LANGUAUE_CHN == Func_Mem_Getsystem_Langue())
    {
        if (type)
        {
            Disp_String16x16_CHN(oledbuff, words, PAGE_TWO, START_FIVE, len, FALSE);
            Disp_String16x16_CHN(oledbuff, USER_ID_CHN, PAGE_THREE, START_FIVE, StringLen(USER_ID_CHN), FALSE);
        }
        else
        {
            Disp_String16x16_CHN(oledbuff, words, PAGE_MIDLE, START_FIVE, len, FALSE);
        }
    }
    if (type)
    {
        Disp_String8x16_ENG(oledbuff, ":", PAGE_THREE, START_NINE, FALSE);
        Disp_UID(oledbuff, uid, PAGE_THREE, START_TEN, FALSE);
    }
    Fill_AllBlock(oledbuff);
}

static void Disp_Time(uint8_t (*OLED_Block)[MAX_COLUMN], uint8_t *ptr, uint8_t flg) //time是BCD格式
{
    if (ptr)
    {
        Disp_Word8x16_ENG(OLED_Block, 0x32, PAGE_FOUR, START_ONE, FALSE);
        Disp_Word8x16_ENG(OLED_Block , 0x30, PAGE_FOUR, START_TWO, FALSE);
        Disp_Word8x16_ENG(OLED_Block, ((ptr[0] & 0xf0) >> 4) + ASCII_NUMBASE, PAGE_FOUR, START_THREE, FALSE);
        Disp_Word8x16_ENG(OLED_Block, (ptr[0] & 0x0f) + ASCII_NUMBASE, PAGE_FOUR, START_FOUR, FALSE);
        Disp_Word8x16_ENG(OLED_Block, ASCII_MIDDLELINE, PAGE_FOUR, START_FIVE, FALSE);

        Disp_Word8x16_ENG(OLED_Block, (ptr[1] >> 4) + ASCII_NUMBASE, PAGE_FOUR, START_SIX, FALSE);
        Disp_Word8x16_ENG(OLED_Block, (ptr[1] & 0x0f) + ASCII_NUMBASE, PAGE_FOUR, START_SEVEN, FALSE);
        Disp_Word8x16_ENG(OLED_Block, ASCII_MIDDLELINE, PAGE_FOUR, START_EIGHT, FALSE);

        Disp_Word8x16_ENG(OLED_Block, (ptr[2] >> 4) + ASCII_NUMBASE, PAGE_FOUR, START_NINE, FALSE);
        Disp_Word8x16_ENG(OLED_Block, (ptr[2] & 0x0f) + ASCII_NUMBASE, PAGE_FOUR, START_TEN, FALSE);

        Disp_Word8x16_ENG(OLED_Block, (ptr[3] >> 4) + ASCII_NUMBASE, PAGE_FOUR, START_TWELVE, FALSE);
        Disp_Word8x16_ENG(OLED_Block, (ptr[3] & 0x0f) + ASCII_NUMBASE, PAGE_FOUR, START_THIRTEEN, FALSE);
        if (flg == TRUE)
        {
            Disp_Word8x16_ENG(OLED_Block, ASCII_STOP, PAGE_FOUR, START_FOURTEEN, FALSE);
        }

        Disp_Word8x16_ENG(OLED_Block, (ptr[4] >> 4) + ASCII_NUMBASE, PAGE_FOUR, START_FIFTEEN, FALSE);
        Disp_Word8x16_ENG(OLED_Block, (ptr[4] & 0x0f) + ASCII_NUMBASE, PAGE_FOUR, START_SIXTEEN, FALSE);
	}
}
static void Disp_SettSelect(uint8_t (*OLED_Block)[MAX_COLUMN], uint8_t select)
{
    uint8_t page;
    uint8_t column;
    for (page = 2 * select; page < 2 * (select + 1); page++)
    {
        for (column = 0; column < MAX_COLUMN; column++)
        {
            OLED_Block[page][column] = NONE;
        }
    }
}

/***********************************************************************
**函数名:Disp_Identify_Another
**功能:双重验证显示
**参数:
**返回值:无
**备注:
***********************************************************************/
static void  Disp_Identify_Another(uint8_t (*OLED_Block)[MAX_COLUMN])
{
    if (LANGUAUE_ENG == Func_Mem_Getsystem_Langue())
    {
        Disp_String8x16_ENG(OLED_Block, "Second User", PAGE_MIDLE, START_THREE, FALSE);
    }
    else if (LANGUAUE_CHN == Func_Mem_Getsystem_Langue())
    {
        Disp_String16x16_CHN(OLED_Block, DOUBLE_IDENTIFY_CHN, PAGE_MIDLE, START_TWO, StringLen(DOUBLE_IDENTIFY_CHN), FALSE);
    }
}
static void Disp_List(uint8_t (*OLED_Block)[MAX_COLUMN], uint8_t index, uint8_t max)
{
    uint8_t i;
    uint8_t start = 0;
    uint8_t flg = FALSE;
    uint8_t end;

    if (index > 3)
        start = index - 3;
    if (max < 4)
        end = max;
    else
        end = 4;
    Disp_SettSelect(OLED_Block, index - start);
    for (i = start; i < end + start; i++)
    {
        if (index == i)
            flg = TRUE;
        else
            flg = FALSE;
        if (i >= 9)
        {
            Disp_Word8x16_ENG(OLED_Block, (i + 1) / 10 + ASCII_NUMBASE, PAGE_BASE * (i - start), START_ONE, flg);
            Disp_Word8x16_ENG(OLED_Block, (i + 1) % 10 + ASCII_NUMBASE, PAGE_BASE * (i - start), START_TWO, flg);
            Disp_Word8x16_ENG(OLED_Block, '.', PAGE_BASE * (i - start), START_THREE, flg);
        }
        else
        {
            Disp_Word8x16_ENG(OLED_Block, i + 1 + ASCII_NUMBASE, PAGE_BASE * (i - start), START_ONE, flg);
            Disp_Word8x16_ENG(OLED_Block, '.', PAGE_BASE * (i-start), START_TWO, flg);
        }
    }
}

static void Disp_OneLine_Words(char *eng_words, uint8_t const **chn_words, uint8_t page, uint8_t start_eng, uint8_t start_chn, uint8_t chn_len)
{
    uint8_t oledbuff[MAX_PAGES][MAX_COLUMN];
    Clear_AllBuff(oledbuff);
    if (LANGUAUE_ENG == Func_Mem_Getsystem_Langue())
    {
        Disp_String8x16_ENG(oledbuff, eng_words, page, start_eng, FALSE);
    }
    else if (LANGUAUE_CHN == Func_Mem_Getsystem_Langue())
    {
        Disp_String16x16_CHN(oledbuff, chn_words, page, start_chn, chn_len, FALSE);
    }

    Fill_AllBlock(oledbuff);
}

void Disp_buff(uint16_t* num)
{
    uint8_t oledbuff[MAX_PAGES][MAX_COLUMN];
    Clear_AllBuff(oledbuff);
    Disp_Flush(oledbuff, num[0], PAGE_ONE, START_ONE);
    Disp_Flush(oledbuff, num[1], PAGE_ONE, START_NINE);

    Disp_Flush(oledbuff, num[2], PAGE_TWO, START_ONE);
    Disp_Flush(oledbuff, num[3], PAGE_TWO, START_NINE);

    Disp_Flush(oledbuff, num[4], PAGE_THREE, START_ONE);
    Disp_Flush(oledbuff, num[5], PAGE_THREE, START_NINE);

    Disp_Flush(oledbuff, num[6], PAGE_FOUR, START_ONE);
    Disp_Flush(oledbuff, num[7], PAGE_FOUR, START_NINE);

    Fill_AllBlock(oledbuff);
}
void Disp_Test(uint16_t data, uint8_t u8x, uint8_t u8y)
{
    uint8_t oledbuff[MAX_PAGES][MAX_COLUMN];
    Clear_AllBuff(oledbuff);
    Disp_Flush(oledbuff, data, u8x, u8y);

    Fill_AllBlock(oledbuff);
}

void Disp_Welcome(uint8_t len, uint8_t level)
{
    uint8_t i;
    char buff[16];
    uint8_t oledbuff[MAX_PAGES][MAX_COLUMN];
    static uint8_t flg = FALSE;
    flg = !flg;
    Clear_AllBuff(oledbuff);
    memset(buff, 0, 16);
    for (i = 0; i < len; i++)
        buff[i] = '*';
    if (len)
    {
        Disp_String8x16_ENG(oledbuff, buff, PAGE_THREE, START_ONE, FALSE);
        if ((len < 16) && (flg))
        {
            Disp_String8x16_ENG(oledbuff, "_", PAGE_THREE, START_BASE * len, FALSE);
        }
    }
    else
    {
        Disp_Logo(oledbuff);
    }
    Disp_Line(oledbuff);
    Disp_TitleWelcome(oledbuff);
    Disp_Bat(oledbuff, level);
    Fill_AllBlock(oledbuff);
}

/***********************************************************************
**函数名:Disp_Idle
**功能:验证状态OLED显示刷新
**参数:
    cnt 验证次数
	len 输入密码长度
	flg 刷新翻转
	level 电量等级
	time BCD时间
**返回值:进程切换
**备注:
***********************************************************************/
void Disp_Idle(uint8_t cnt, uint8_t len, uint8_t flg, uint8_t level, uint8_t *time)
{
    uint8_t i;
    char buff[LINE_STRING_MAX];
    uint8_t oledbuff[MAX_PAGES][MAX_COLUMN];
    void *logo;
    uint8_t logotype;

    logotype = Func_Get_Logo_Information(&logo);
    //flg = !flg;
    if (len > LINE_STRING_MAX)
    {
        len = LINE_STRING_MAX;
    }
    Clear_AllBuff(oledbuff);
    memset(buff, 0, LINE_STRING_MAX);
    for (i = 0; i < len; i++)
    {
        buff[i] = '*';
    }
    if (len)
    {
        Disp_String8x16_ENG(oledbuff, buff, PAGE_THREE, START_ONE, FALSE);
        if (flg)
        {
            Disp_String8x16_ENG(oledbuff, "_", PAGE_THREE, START_BASE*len, FALSE);
        }
    }
    else
    {
        if (cnt)
        {
            Disp_Identify_Another(oledbuff);
        }
        else
        {
            if (DEFAULT_LOGO == logotype)
            {
                Disp_Logo(oledbuff);
            }
            else
            {
                Disp_Logo_Custom(logotype, oledbuff, logo);
            }
        }
    }
    if ((FULLSCREEN_LOGO != logotype) || (len))// 全屏logo显示且没有数字输入时不显示电量等
    {
        Disp_TitleWelcome(oledbuff);
        Disp_Bat(oledbuff, level);
        Disp_Line(oledbuff);
    }
    if ((logotype < THREELINE_LOGO) || (len))// 全屏和三行logo且没有输入数字时不显示时间
    {
        Disp_Time(oledbuff, time, flg);
    }
    if (len > 1)
    {
        Fill_Block(oledbuff, PAGE_THREE, PAGE_FOUR, START_BASE * (len - 1), START_BASE * ((len < LINE_STRING_MAX) ? (len + 1) : len));
        Fill_Block(oledbuff, PAGE_FOUR, PAGE_BOTTOM, START_FOURTEEN, START_FIFTEEN);
    }
    else
    {
        Fill_AllBlock(oledbuff);//第一次刷整屏
    }
}

void Disp_test_Mode(uint8_t status)
{
    uint8_t oledbuff[MAX_PAGES][MAX_COLUMN];
    if (status)
    {
        memset(oledbuff, 0xff, MAX_PAGES * MAX_COLUMN);
    }
    else
    {
        memset(oledbuff, 0, MAX_PAGES * MAX_COLUMN);
    }

    Fill_AllBlock(oledbuff);
}
void Disp_Burn_In(uint16_t count, uint32_t current)
{
    Disp_test_Mode(FALSE);
}
/***********************************************************************
**函数名:Disp_OpRecord
**功能:显示开门记录
**参数:

**返回值:无
**备注:
***********************************************************************/
void Disp_OpRecord(uint8_t operate, uint8_t utype, uint16_t id, uint8_t time[])
{
    uint8_t oledbuff[MAX_PAGES][MAX_COLUMN];

    Clear_AllBuff(oledbuff);

    if (LANGUAUE_ENG == Func_Mem_Getsystem_Langue())
    {
        Disp_String8x16_ENG(oledbuff, "Op  :", PAGE_ONE, START_ONE, FALSE);
        Disp_String8x16_ENG(oledbuff, "Type:", PAGE_TWO, START_ONE, FALSE);
        Disp_String8x16_ENG(oledbuff, "UID :", PAGE_THREE, START_ONE, FALSE);
        if ((operate) && (operate <= sizeof(RECORD_OPERATE_ENG) / sizeof(RECORD_OPERATE_ENG[0])))
        {
            Disp_String8x16_ENG(oledbuff, RECORD_OPERATE_ENG[operate-1], PAGE_ONE, START_SIX, FALSE);
        }
    }
    else if (LANGUAUE_CHN == Func_Mem_Getsystem_Langue())
    {
        Disp_String16x16_CHN(oledbuff, OPTION_TAB, PAGE_ONE, START_ONE, 2, FALSE); //操作
        Disp_String16x16_CHN(oledbuff, USER_TYPE_TAB, PAGE_TWO, START_ONE, 2, FALSE); //类型
        Disp_String16x16_CHN(oledbuff, USER_ID_CHN, PAGE_THREE, START_ONE, StringLen(USER_ID_CHN), FALSE);
        Disp_String8x16_ENG(oledbuff, ":", PAGE_ONE, START_FIVE, FALSE);
        Disp_String8x16_ENG(oledbuff, ":", PAGE_TWO, START_FIVE, FALSE);
        Disp_String8x16_ENG(oledbuff, ":", PAGE_THREE, START_FIVE, FALSE);

        if ((operate) && (operate <= sizeof(RECORD_OPERATE_CHN) / sizeof(RECORD_OPERATE_CHN[0])))
        {
            Disp_String16x16_CHN(oledbuff, RECORD_OPERATE_CHN[operate - 1], PAGE_ONE, START_SIX, Menu_List_RECORD_OPERATE[operate-1], FALSE); //开门操作
        }
    }

    if ((RECORD_OPERATION_RESET != operate) && (RECORD_OPERATION_INIT != operate))
    {
        if (LANGUAUE_ENG == Func_Mem_Getsystem_Langue())
        {
            if ((utype) && (utype <= sizeof(RECORD_TYPE_ENG) / sizeof(RECORD_TYPE_ENG[0])))
            {
                Disp_String8x16_ENG(oledbuff, RECORD_TYPE_ENG[utype - 1], PAGE_TWO, START_SIX, FALSE);
            }
        }
        else if (LANGUAUE_CHN == Func_Mem_Getsystem_Langue())
        {
            if ((utype) && (utype <= sizeof(RECORD_TYPE_CHN) / sizeof(RECORD_TYPE_CHN[0])))
            {
                Disp_String16x16_CHN(oledbuff, RECORD_TYPE_CHN[utype-1], PAGE_TWO, START_SIX, Menu_List_RECORD_TYPE[utype-1], FALSE); //开门操作
            }
        }
    }
    if ((RECORD_OPERATION_OPENDOOR == operate) || (RECORD_OPERATION_ADD == operate) || (RECORD_OPERATION_DELETE == operate) || (RECORD_OPERATION_CHANGE == operate))
    {
        Disp_UID(oledbuff, id, PAGE_THREE, START_SIX, FALSE);
    }
    Disp_Time(oledbuff, time, TRUE);
    Fill_AllBlock(oledbuff);
}
/***********************************************************************
**函数名:Disp_Ver
**功能:显示版本等信息
**参数:
**返回值:无
**备注:
***********************************************************************/
void  Disp_Ver(char *ver)
{
    uint8_t oledbuff[MAX_PAGES][MAX_COLUMN];
    Clear_AllBuff(oledbuff);
    if (ver)
    {
        Disp_String8x16_ENG(oledbuff, ver, PAGE_MIDLE, START_ONE, FALSE);
    }
    Fill_AllBlock(oledbuff);
}
/***********************************************************************
**函数名:Disp_Input_Finger
**功能:请放手指
**参数:
**返回值:无
**备注:
***********************************************************************/
void  Disp_Input_Finger(void)
{
    Disp_OneLine_Words("Press Finger", INPUT_FINGER_CHN, PAGE_MIDLE, START_TWO, START_FIVE, StringLen(INPUT_FINGER_CHN));
}
#ifdef FUNC_SUPPORT_FACE
/***********************************************************************
**函数名:Disp_Face_Camera
**功能:请正对摄像头
**参数:
**返回值:无
**备注:
***********************************************************************/
void  Disp_Face_Camera(void)
{
    Disp_OneLine_Words("Face Camera", FACE_CAMERA_CHN, PAGE_MIDLE, START_THREE, START_THREE, StringLen(FACE_CAMERA_CHN));
}

/***********************************************************************
**函数名:Disp_Face_Up
**功能:脸部朝上
**参数:
**返回值:无
**备注:
***********************************************************************/
void  Disp_Face_Up(void)
{
    Disp_OneLine_Words("Face Up", FACE_UP_CHN, PAGE_MIDLE, START_THREE, START_THREE, StringLen(FACE_UP_CHN));
}
/***********************************************************************
**函数名:Disp_Face_Down
**功能:脸部朝下
**参数:
**返回值:无
**备注:
***********************************************************************/
void  Disp_Face_Down(void)
{
    Disp_OneLine_Words("Face Down", FACE_DOWN_CHN, PAGE_MIDLE, START_THREE, START_THREE, StringLen(FACE_DOWN_CHN));
}

/***********************************************************************
**函数名:Disp_Face_Left
**功能:脸部朝左
**参数:
**返回值:无
**备注:
***********************************************************************/
void  Disp_Face_Left(void)
{
    Disp_OneLine_Words("Face Left", FACE_LEFT_CHN, PAGE_MIDLE, START_THREE, START_THREE, StringLen(FACE_LEFT_CHN));
}

/***********************************************************************
**函数名:Disp_Face_Up
**功能:脸部朝上
**参数:
**返回值:无
**备注:
***********************************************************************/
void  Disp_Face_Right(void)
{
    Disp_OneLine_Words("Face Right", FACE_RIGHT_CHN, PAGE_MIDLE, START_THREE, START_THREE, StringLen(FACE_RIGHT_CHN));
}
/***********************************************************************
**函数名:Disp_UserFull
**功能:用户已满
**参数:
**返回值:无
**备注:
***********************************************************************/
void  Disp_FaceFull(void)
{
    Disp_OneLine_Words("Face Full", FACEFULL_CHN, PAGE_MIDLE, START_FOUR, START_THREE, StringLen(FACEFULL_CHN));
}
/***********************************************************************
**函数名:Disp_No_Face
**功能:无人脸
**参数:
**返回值:无
**备注:
***********************************************************************/
void  Disp_No_Face(void)
{
    Disp_OneLine_Words("No Face", NO_FACE_CHN, PAGE_MIDLE, START_FIVE, START_FIVE, StringLen(NO_FACE_CHN));
}

void Disp_Menu_Add_User(uint8_t select, uint8_t max)
{
    uint8_t oledbuff[MAX_PAGES][MAX_COLUMN];
    Clear_AllBuff(oledbuff);
    Disp_List(oledbuff, select, max);
    if (LANGUAUE_ENG == Func_Mem_Getsystem_Langue())
    {
        Disp_MenuEng_List(oledbuff, select, max, (char **)MENU_ADD_USER_ENG);
    }
    else if (LANGUAUE_CHN == Func_Mem_Getsystem_Langue())
    {
        Disp_MenuChn_List(oledbuff, select, max, MENU_ADD_USER_CHN, Menu_List_Add_User);
    }
    Fill_AllBlock(oledbuff);
}

void Disp_Menu_Delete_User(uint8_t select, uint8_t max)
{
    uint8_t oledbuff[MAX_PAGES][MAX_COLUMN];
    Clear_AllBuff(oledbuff);
    Disp_List(oledbuff, select, max);
    if (LANGUAUE_ENG == Func_Mem_Getsystem_Langue())
    {
        Disp_MenuEng_List(oledbuff, select, max, (char **)MENU_DELETE_SINGLE_USER_ENG);
    }
    else if (LANGUAUE_CHN == Func_Mem_Getsystem_Langue())
    {
        Disp_MenuChn_List(oledbuff, select, max, MENU_DELETE_SINGLE_USER_CHN, Menu_Delete_Single_User);
    }
    Fill_AllBlock(oledbuff);
}
/***********************************************************************
**函数名:Disp_Identify_Sucess
**功能:验证成功
**参数:
**返回值:无
**备注:
***********************************************************************/
void  Disp_Set_Face_Sensitivity(uint8_t param)
{
    uint8_t oledbuff[MAX_PAGES][MAX_COLUMN];
    Clear_AllBuff(oledbuff);
    if (LANGUAUE_ENG == Func_Mem_Getsystem_Langue())
    {
        Disp_String8x16_ENG(oledbuff, "Set Param", PAGE_TWO, START_FOUR, FALSE);
        Disp_String8x16_ENG(oledbuff, FACE_SENSITIVITY_SELECT_ENG[param], PAGE_THREE, START_SEVEN, FALSE);
    }
    else if (LANGUAUE_CHN == Func_Mem_Getsystem_Langue())
    {
        Disp_String16x16_CHN(oledbuff, INPUT_PARAM_CHN, PAGE_TWO, START_FOUR, StringLen(INPUT_PARAM_CHN), FALSE);
        Disp_String16x16_CHN(oledbuff, FACE_SENSITIVITY_SELECT_CHN[param], PAGE_THREE, START_SEVEN, Face_Sensitivity_List[param], FALSE);
    }

    Fill_AllBlock(oledbuff);
}
#endif

/***********************************************************************
**函数名:Disp_InSure_Cancel
**功能:确认请按# 取消按*
**参数:
**返回值:无
**备注:
***********************************************************************/
void  Disp_InSure_Cancel(void)
{
    uint8_t oledbuff[MAX_PAGES][MAX_COLUMN];
    Clear_AllBuff(oledbuff);

    if (LANGUAUE_ENG == Func_Mem_Getsystem_Langue())
    {
        Disp_String8x16_ENG(oledbuff, "Cancle(*)", PAGE_FOUR, START_ONE, FALSE);
        Disp_String8x16_ENG(oledbuff, "Yes(#)", PAGE_FOUR, START_ELEVEN, FALSE);
    }
    else if (LANGUAUE_CHN == Func_Mem_Getsystem_Langue())
    {
        Disp_String16x16_CHN(oledbuff, CANCLE_CHN, PAGE_FOUR, START_ONE, StringLen(CANCLE_CHN), FALSE);
        Disp_String8x16_ENG(oledbuff, "(*)", PAGE_FOUR, START_FIVE, FALSE);
        Disp_String16x16_CHN(oledbuff, INSURE_CHN, PAGE_FOUR, START_TEN, StringLen(INSURE_CHN), FALSE);
        Disp_String8x16_ENG(oledbuff, "(#)", PAGE_FOUR, START_FOURTEEN, FALSE);
    }
    Fill_AllBlock(oledbuff);
}

/***********************************************************************
**函数名:Disp_Identify_Fail
**功能:验证错误
**参数:
**返回值:无
**备注:
***********************************************************************/
void  Disp_Identify_Fail(void)
{
    Disp_OneLine_Words("Failed", IDENTIFYFAIL_CHN, PAGE_MIDLE, START_FIVE, START_FIVE, StringLen(IDENTIFYFAIL_CHN));
}
/***********************************************************************
**函数名:Disp_Identify_Sucess
**功能:验证成功
**参数:
**返回值:无
**备注:
***********************************************************************/
void  Disp_Identify_Sucess(uint8_t type, uint16_t uid)
{
    Disp_Sucess_UID(type, uid, IDENTIFYSUCESS_CHN, StringLen(IDENTIFYSUCESS_CHN));
}

/***********************************************************************
**函数名:Disp_Password_Easy
**功能:密码过于简单
**参数:
**返回值:无
**备注:
***********************************************************************/
void  Disp_Password_Easy(void)
{
    Disp_OneLine_Words("PWD Too Easy", PASSWORD_EASY_CHN, PAGE_MIDLE, START_TWO, START_THREE, StringLen(PASSWORD_EASY_CHN));
}

/***********************************************************************
**函数名:Disp_Add_Fail
**功能:添加失败
**参数:
**返回值:无
**备注:
***********************************************************************/
void  Disp_Add_Fail(void)
{
    Disp_OneLine_Words("Failed", ADDFAIL_CHN, PAGE_MIDLE, START_FIVE, START_FIVE, StringLen(ADDFAIL_CHN));
}


/***********************************************************************
**函数名:Disp_Add_Sucess
**功能:添加成功
**参数:
**返回值:无
**备注:
***********************************************************************/
void Disp_Add_Sucess(uint8_t type, uint16_t uid)
{
    Disp_Sucess_UID(type, uid, OPERASUCCESS_CHN, StringLen(OPERASUCCESS_CHN));
}

/***********************************************************************
**函数名:Disp_Delete_Fail
**功能:删除失败
**参数:
**返回值:无
**备注:
***********************************************************************/
void  Disp_Delete_Fail(void)
{
    Disp_OneLine_Words("Failed", DELETE_FAIL_CHN, PAGE_MIDLE, START_FIVE, START_FIVE, StringLen(DELETE_FAIL_CHN));
}
/***********************************************************************
**函数名:Disp_Delete_Sucess
**功能:删除成功
**参数:
**返回值:无
**备注:
***********************************************************************/
void  Disp_Delete_Sucess(void)
{
    Disp_OneLine_Words("Succeeded", DELETE_SUCCESS_CHN, PAGE_MIDLE, START_FOUR, START_FIVE, StringLen(DELETE_SUCCESS_CHN));
}

/***********************************************************************
**函数名:Disp_Set_Fail
**功能:设置失败
**参数:
**返回值:无
**备注:
***********************************************************************/
void  Disp_Set_Fail(void)
{
    Disp_OneLine_Words("Failed", SET_FAIL_CHN, PAGE_MIDLE, START_FIVE, START_FIVE, StringLen(SET_FAIL_CHN));
}
/***********************************************************************
**函数名:Disp_Set_Sucess
**功能:设置成功
**参数:
**返回值:无
**备注:
***********************************************************************/
void  Disp_Set_Sucess(void)
{
    Disp_OneLine_Words("Succeeded", SET_SUCCESS_CHN, PAGE_MIDLE, START_FOUR, START_FIVE, StringLen(SET_SUCCESS_CHN));
}

/***********************************************************************
**函数名:Disp_Identify_Sucess
**功能:验证成功
**参数:
**返回值:无
**备注:
***********************************************************************/
void  Disp_Unlock(void)
{
    Disp_OneLine_Words("UnLock", UNLOCK_CHN, PAGE_MIDLE, START_FOUR, START_SIX, StringLen(UNLOCK_CHN));
}

/***********************************************************************
**函数名:Disp_Identify_Sucess
**功能:验证成功
**参数:
**返回值:无
**备注:
***********************************************************************/
void  Disp_Lock(void)
{
    Disp_OneLine_Words("Lock", LOCK_CHN, PAGE_MIDLE, START_FOUR, START_SIX, StringLen(LOCK_CHN));
}

/***********************************************************************
**函数名:Disp_Identify_Sucess
**功能:验证成功
**参数:
**返回值:无
**备注:
***********************************************************************/
void  Disp_Unlocking(void)
{
    Disp_OneLine_Words("UnLocking", UNLOCKING_CHN, PAGE_MIDLE, START_FOUR, START_SIX, StringLen(UNLOCKING_CHN));
}

/***********************************************************************
**函数名:Disp_Identify_Sucess
**功能:验证成功
**参数:
**返回值:无
**备注:
***********************************************************************/
void  Disp_Locking(void)
{
    Disp_OneLine_Words("Locking", LOCKING_CHN, PAGE_MIDLE, START_FOUR, START_SIX, StringLen(LOCKING_CHN));
}

/***********************************************************************
**函数名:Disp_Identify_Sucess
**功能:验证成功
**参数:
**返回值:无
**备注:
***********************************************************************/
void  Disp_Set_Param(uint16_t param, char *eng_words)
{
    uint8_t oledbuff[MAX_PAGES][MAX_COLUMN];
    Clear_AllBuff(oledbuff);
    if (LANGUAUE_ENG == Func_Mem_Getsystem_Langue())
    {
        Disp_String8x16_ENG(oledbuff, "Set Param", PAGE_TWO, START_FOUR, FALSE);
    }
    else if (LANGUAUE_CHN == Func_Mem_Getsystem_Langue())
    {
        Disp_String16x16_CHN(oledbuff, INPUT_PARAM_CHN, PAGE_TWO, START_FOUR, StringLen(INPUT_PARAM_CHN), FALSE);
    }
    if (eng_words)
    {
        if (param >= 100)
        {
            Disp_Num(oledbuff, param / 100, PAGE_THREE, START_SIX, FALSE);
        }
        if (param >= 10)
        {
            Disp_Num(oledbuff, (param % 100) / 10, PAGE_THREE, START_SEVEN, FALSE);
        }
        Disp_Num(oledbuff, param % 10, PAGE_THREE, START_EIGHT, FALSE);
        Disp_String8x16_ENG(oledbuff, eng_words, PAGE_THREE, START_NINE, FALSE);
    }
    else
    {
        Disp_String16x16_CHN(oledbuff, CLOSE_CHN, PAGE_THREE, START_SEVEN, StringLen(CLOSE_CHN), FALSE);
    }

    Fill_AllBlock(oledbuff);
}




/***********************************************************************
**函数名:Disp_System_Lock
**功能:非法操作 系统已锁定
**参数:
**返回值:无
**备注:
***********************************************************************/
void  Disp_System_Lock(uint8_t type, uint16_t time)
{
    uint8_t oledbuff[MAX_PAGES][MAX_COLUMN];
    char num[4] = {0, 0, 0, 0};
    Clear_AllBuff(oledbuff);
    if (time < 1000)
    {
        num[0] = time / 100 + '0';
        num[1] = (time % 100) / 10 + '0';
        num[2] = time % 10 + '0';
    }
    if (LANGUAUE_ENG == Func_Mem_Getsystem_Langue())
    {
        Disp_String8x16_ENG(oledbuff, "Error", PAGE_TWO, START_SIX, FALSE);
        if (type == USER_FINGER)
        {
            Disp_String8x16_ENG(oledbuff, "Finger Locked", PAGE_THREE, START_TWO, FALSE);
        }
        else if (type == USER_PASSWORD)
        {
            Disp_String8x16_ENG(oledbuff, "PWD Locked", PAGE_THREE, START_THREE, FALSE);
        }
        else if (type == USER_CARD)
        {
            Disp_String8x16_ENG(oledbuff, "Card Locked", PAGE_THREE, START_THREE, FALSE);
        }
        else
        {
            Disp_String8x16_ENG(oledbuff, "System Locked", PAGE_THREE, START_TWO, FALSE);
        }
        Disp_String8x16_ENG(oledbuff, "Locked Time", PAGE_FOUR, START_ONE, FALSE);
        Disp_String8x16_ENG(oledbuff, num, PAGE_FOUR, START_THIRTEEN, FALSE);
    }
    else if (LANGUAUE_CHN == Func_Mem_Getsystem_Langue())
    {
        Disp_String16x16_CHN(oledbuff, INVALID_CHN, PAGE_TWO, START_FIVE, StringLen(INVALID_CHN), FALSE);
        if (type == USER_FINGER)
        {
            Disp_String16x16_CHN(oledbuff, FINGER_LOCK_CHN, PAGE_THREE, START_FIVE, StringLen(FINGER_LOCK_CHN), FALSE);
        }
        else if (type == USER_PASSWORD)
        {
            Disp_String16x16_CHN(oledbuff, KEY_LOCK_CHN, PAGE_THREE, START_FIVE, StringLen(KEY_LOCK_CHN), FALSE);
        }
        else if (type == USER_CARD)
        {
            Disp_String16x16_CHN(oledbuff, CARD_LOCK_CHN, PAGE_THREE, START_SIX, StringLen(CARD_LOCK_CHN), FALSE);
        }
        else
        {
            Disp_String16x16_CHN(oledbuff, SYSLOCK_CHN, PAGE_THREE, START_FIVE, StringLen(SYSLOCK_CHN), FALSE);
        }
        Disp_String16x16_CHN(oledbuff, LOCK_TIME_CHN, PAGE_FOUR, START_ONE, StringLen(LOCK_TIME_CHN), FALSE);
        Disp_String8x16_ENG(oledbuff, num, PAGE_FOUR, START_TEN, FALSE);
        Disp_String16x16_CHN(oledbuff, SECOND_TIME_CHN, PAGE_FOUR, START_FOURTEEN, StringLen(SECOND_TIME_CHN), FALSE);
    }

    Fill_AllBlock(oledbuff);
}
/***********************************************************************
**函数名:Disp_UserFull
**功能:用户已满
**参数:
**返回值:无
**备注:
***********************************************************************/
void  Disp_UserFull(void)
{
    Disp_OneLine_Words("User Full", USERFULL_CHN, PAGE_MIDLE, START_FOUR, START_FIVE, StringLen(USERFULL_CHN));
}

/***********************************************************************
**函数名:Disp_No_Finger
**功能:无指纹
**参数:
**返回值:无
**备注:
***********************************************************************/
void  Disp_No_Finger(void)
{
    Disp_OneLine_Words("No User", NO_FINGER_CHN, PAGE_MIDLE, START_FIVE, START_FIVE, StringLen(NO_FINGER_CHN));
}

/***********************************************************************
**函数名:Disp_No_Card
**功能:无卡
**参数:
**返回值:无
**备注:
***********************************************************************/
void  Disp_No_Card(void)
{
    Disp_OneLine_Words("No User", NO_CARD_CHN, PAGE_MIDLE, START_FIVE, START_FIVE, StringLen(NO_CARD_CHN));
}

/***********************************************************************
**函数名:Disp_No_Password
**功能:无密码
**参数:
**返回值:无
**备注:
***********************************************************************/
void  Disp_No_Password(void)
{
    Disp_OneLine_Words("No User", NO_PASSWORD_CHN, PAGE_MIDLE, START_FIVE, START_FIVE, StringLen(NO_PASSWORD_CHN));
}

/***********************************************************************
**函数名:Disp_NoUser
**功能:用户不存在
**参数:
**返回值:无
**备注:
***********************************************************************/
void  Disp_NoUser(void)
{
    Disp_OneLine_Words("No User", NOUSER_CHN, PAGE_MIDLE, START_FIVE, START_THREE, StringLen(NOUSER_CHN));
}

/***********************************************************************
**函数名:Disp_NoUser
**功能:用户不存在
**参数:
**返回值:无
**备注:
***********************************************************************/
void  Disp_NoneRecord(void)
{
    Disp_OneLine_Words("No Record", NONERECORD_CHN, PAGE_MIDLE, START_FOUR, START_FIVE, StringLen(NONERECORD_CHN));
}

/***********************************************************************
**函数名:Disp_UserExist
**功能:用户已存在
**参数:
**返回值:无
**备注:
***********************************************************************/
void  Disp_UserExist(void)
{
    Disp_OneLine_Words("User Exist", USEREXIST_CHN, PAGE_MIDLE, START_FOUR, START_FOUR, StringLen(USEREXIST_CHN));
}
/***********************************************************************
**函数名:Disp_FingerFull
**功能:指纹已满
**参数:
**返回值:无
**备注:
***********************************************************************/
void  Disp_FingerFull(void)
{
    Disp_OneLine_Words("Fingers Full", FINGERFULL_CHN, PAGE_MIDLE, START_THREE, START_FIVE, StringLen(FINGERFULL_CHN));
}

/***********************************************************************
**函数名:Disp_CardFull
**功能:卡已满
**参数:
**返回值:无
**备注:
***********************************************************************/
void  Disp_CardFull(void)
{
    Disp_OneLine_Words("Cards Full", CARDFULL_CHN, PAGE_MIDLE, START_THREE, START_FIVE, StringLen(CARDFULL_CHN));
}
/***********************************************************************
**函数名:Disp_PasswordFull
**功能:密码已满
**参数:
**返回值:无
**备注:
***********************************************************************/
void  Disp_PasswordFull(void)
{
    Disp_OneLine_Words("PWD Full", PASSWORD_FULL_CHN, PAGE_MIDLE, START_THREE, START_FIVE, StringLen(PASSWORD_FULL_CHN));
}
/***********************************************************************
**函数名:Disp_OperaFail
**功能:操作错误
**参数:
**返回值:无
**备注:
***********************************************************************/
void  Disp_OperaFail(void)
{
    Disp_OneLine_Words("Failed", OPERAFAIL_CHN, PAGE_MIDLE, START_FIVE, START_FIVE, StringLen(OPERAFAIL_CHN));
}
/***********************************************************************
**函数名:Disp_OperaSuccess
**功能:操作成功
**参数:
**返回值:无
**备注:
***********************************************************************/
void  Disp_OperaSuccess(void)
{
    Disp_OneLine_Words("Succeeded", OPERASUCCESS_CHN, PAGE_MIDLE, START_FOUR, START_FIVE, StringLen(OPERASUCCESS_CHN));
}

/***********************************************************************
**函数名:Disp_Get_Secret_Key
**功能:加密中
**参数:
**返回值:无
**备注:
***********************************************************************/
void  Disp_Encrypting(void)
{
    Disp_OneLine_Words("Encrypting..", ENCRYPTING_CHN, PAGE_MIDLE, START_THREE, START_SIX, StringLen(ENCRYPTING_CHN));
}

/***********************************************************************
**函数名:Disp_OperaSuccess
**功能:操作错误
**参数:
**返回值:无
**备注:
***********************************************************************/
void  Disp_FingerAgain(void)
{
    uint8_t oledbuff[MAX_PAGES][MAX_COLUMN];
    Clear_AllBuff(oledbuff);
    if (LANGUAUE_ENG == Func_Mem_Getsystem_Langue())
    {
        Disp_String8x16_ENG(oledbuff, "Move Finger", PAGE_TWO, START_THREE, FALSE);
        Disp_String8x16_ENG(oledbuff, "Input Again", PAGE_THREE, START_THREE, FALSE);
    }
    else if (LANGUAUE_CHN == Func_Mem_Getsystem_Langue())
    {
        Disp_String16x16_CHN(oledbuff, MOVE_FINGER_CHN, PAGE_TWO, START_FOUR, StringLen(MOVE_FINGER_CHN), FALSE);
        Disp_String16x16_CHN(oledbuff, PUT_AGAIN_CHN, PAGE_THREE, START_FIVE, StringLen(PUT_AGAIN_CHN), FALSE);
    }

    Fill_AllBlock(oledbuff);
}

/***********************************************************************
**函数名:Disp_Wait
**功能:请稍后。。。
**参数:
**返回值:无
**备注:
***********************************************************************/
void  Disp_Wait(void)
{
    Disp_OneLine_Words("Wait...", WAIT_CHN, PAGE_MIDLE, START_FIVE, START_FIVE, StringLen(WAIT_CHN));
}

/***********************************************************************
**函数名:Disp_AlwaysOn
**功能:常开已打开
**参数:
**返回值:无
**备注:
***********************************************************************/
void  Disp_AlwaysOn(void)
{
    Disp_OneLine_Words("Always On", ALWAYS_ON_CHN, PAGE_MIDLE, START_FIVE, START_FIVE, StringLen(ALWAYS_ON_CHN));
}


/***********************************************************************
**函数名:Disp_SingleMode
**功能:单开模式
**参数:
**返回值:无
**备注:
***********************************************************************/
void  Disp_SingleMode(void)
{
    Disp_OneLine_Words("Single Mode", SINGLEMODE_CHN, PAGE_MIDLE, START_THREE, START_FIVE, StringLen(SINGLEMODE_CHN));
}

/***********************************************************************
**函数名:Disp_DouobleMode
**功能:双开模式
**参数:
**返回值:无
**备注:
***********************************************************************/
void  Disp_DouobleMode(void)
{
    Disp_OneLine_Words("Double Mode", DOUBLEMODE_CHN, PAGE_MIDLE, START_THREE, START_FIVE, StringLen(DOUBLEMODE_CHN));
}

/***********************************************************************
**函数名:Disp_FactoryReset_Sucess
**功能:恢复出厂设置成功
**参数:
**返回值:无
**备注:
***********************************************************************/
void  Disp_FactoryReset_Sucess(void)
{
    Disp_OneLine_Words("Factory Reset", FACTORY_RESET_SUCESS_CHN, PAGE_MIDLE, START_TWO, START_ONE, StringLen(FACTORY_RESET_SUCESS_CHN));
}


//时间设置
void Disp_Set_Time(uint8_t flg, uint8_t len, uint8_t *ptr)
{
    uint8_t i;
    uint8_t buff[12];
    uint8_t oledbuff[MAX_PAGES][MAX_COLUMN];
    if (len > 12)
    {
        return;
    }
    for (i = 0; i < 12; i++)
    {
        if ((len != i) || (flg == FALSE))
        {
            buff[i] = ASCII_BOTTOMLINE;
        }
        else
        {
            buff[i] = 0;
        }
    }
    for (i = 0; i < len; i++)
    {
        buff[i] = ptr[i] + ASCII_NUMBASE;
    }
    Clear_AllBuff(oledbuff);

    Disp_String8x16_ENG(oledbuff, "20", PAGE_TWO, START_FOUR, FALSE);
    Disp_Word8x16_ENG(oledbuff, buff[0], PAGE_TWO, START_SIX, FALSE);
    Disp_Word8x16_ENG(oledbuff, buff[1], PAGE_TWO, START_SEVEN, FALSE);
    Disp_String8x16_ENG(oledbuff, "-", PAGE_TWO, START_EIGHT, FALSE);
    Disp_Word8x16_ENG(oledbuff, buff[2], PAGE_TWO, START_NINE, FALSE);
    Disp_Word8x16_ENG(oledbuff, buff[3], PAGE_TWO, START_TEN, FALSE);
    Disp_String8x16_ENG(oledbuff, "-", PAGE_TWO, START_ELEVEN, FALSE);
    Disp_Word8x16_ENG(oledbuff, buff[4], PAGE_TWO, START_TWELVE, FALSE);
    Disp_Word8x16_ENG(oledbuff, buff[5], PAGE_TWO, START_THIRTEEN, FALSE);
    Disp_Word8x16_ENG(oledbuff, buff[6], PAGE_THREE, START_SIX, FALSE);
    Disp_Word8x16_ENG(oledbuff, buff[7], PAGE_THREE, START_SEVEN, FALSE);
    Disp_String8x16_ENG(oledbuff, ":", PAGE_THREE, START_EIGHT, FALSE);
    Disp_Word8x16_ENG(oledbuff, buff[8], PAGE_THREE, START_NINE, FALSE);
    Disp_Word8x16_ENG(oledbuff, buff[9], PAGE_THREE, START_TEN, FALSE);
    Disp_String8x16_ENG(oledbuff, ":", PAGE_THREE, START_ELEVEN, FALSE);
    Disp_Word8x16_ENG(oledbuff, buff[10], PAGE_THREE, START_TWELVE, FALSE);
    Disp_Word8x16_ENG(oledbuff, buff[11], PAGE_THREE, START_THIRTEEN, FALSE);
    if ((len == 0) || (len == 6))
    {
        Fill_AllBlock(oledbuff);
    }
    else if (len < 6)
    {
        Fill_Block(oledbuff, PAGE_TWO, PAGE_THREE, 0, START_SIXTEEN);
    }
    else
    {
        Fill_Block(oledbuff, PAGE_THREE, PAGE_FOUR, 0, START_SIXTEEN);
    }
}

void Disp_Input_KeyValue(uint8_t len, uint8_t *pw)
{
    uint8_t oledbuff[MAX_PAGES][MAX_COLUMN];
    Clear_AllBuff(oledbuff);
    Disp_Password_num(oledbuff,pw,len,PAGE_MIDLE,TRUE);
    if(len > 1)
    {
        Fill_Block(oledbuff,PAGE_MIDLE,PAGE_MIDLE+2,START_BASE*(len-1),START_BASE * ((len < LINE_STRING_MAX) ? (len + 1) : len));
    }
    else
    {
        Fill_AllBlock(oledbuff);//第一次刷整屏
    }
}

void Disp_Input_ManageInfo(unsigned char len, unsigned char flg)
{
    unsigned char i;
    uint8_t oledbuff[MAX_PAGES][MAX_COLUMN];
    Clear_AllBuff(oledbuff);
    if (len > LINE_STRING_MAX)
    {
        len = LINE_STRING_MAX;
    }
    if (LANGUAUE_ENG == Func_Mem_Getsystem_Langue())
    {
        Disp_String8x16_ENG(oledbuff, "Input Admin Info", PAGE_TWO, START_ONE, FALSE);
    }
    else if (LANGUAUE_CHN == Func_Mem_Getsystem_Langue())
    {
        Disp_String16x16_CHN(oledbuff, INPUTMANAGE_CHN, PAGE_TWO, START_TWO, StringLen(INPUTMANAGE_CHN), FALSE);
    }
    for (i = 0; i < len; i++)
    {
        if (i < LINE_STRING_MAX)
        {
            Disp_Word8x16_ENG(oledbuff, ASCII_STAR, PAGE_THREE, START_BASE * i, FALSE);
        }
        else
        {
            break;
        }
    }
    if ((i < LINE_STRING_MAX) && (flg == TRUE))
    {
        Disp_Word8x16_ENG(oledbuff, ASCII_BOTTOMLINE, PAGE_THREE, START_BASE * i, FALSE);
    }
    if (len > 1)
    {
        Fill_Block(oledbuff, PAGE_THREE, PAGE_FOUR, START_BASE * (len - 1), START_BASE * ((len < LINE_STRING_MAX) ? (len + 1) : len));
    }
    else
    {
        Fill_AllBlock(oledbuff);//第一次刷整屏
    }
}
void Disp_Input_Admin(uint8_t type)
{
    uint8_t oledbuff[MAX_PAGES][MAX_COLUMN];
    Clear_AllBuff(oledbuff);
    if (LANGUAUE_ENG == Func_Mem_Getsystem_Langue())
    {
        Disp_String8x16_ENG(oledbuff, "Input Admin PWD", PAGE_MIDLE, START_ONE, FALSE);
    }
    else if (LANGUAUE_CHN == Func_Mem_Getsystem_Langue())
    {
        if (type)
        {
            Disp_String16x16_CHN(oledbuff, INPUT_ADMIN_PASSWORD_CHN, PAGE_TWO, START_TWO, StringLen(INPUT_ADMIN_PASSWORD_CHN), FALSE);
        }
        else
        {
            Disp_String16x16_CHN(oledbuff, SET_ADMIN_PASSWORD_CHN, PAGE_TWO, START_TWO, StringLen(INPUT_ADMIN_PASSWORD_CHN), FALSE);
        }

    }
    Fill_AllBlock(oledbuff);
}
void Disp_Input_Password_Again(uint8_t len)
{
    uint8_t oledbuff[MAX_PAGES][MAX_COLUMN];
    Clear_AllBuff(oledbuff);
    if (LANGUAUE_ENG == Func_Mem_Getsystem_Langue())
    {
        Disp_String8x16_ENG(oledbuff, "Input Again", PAGE_MIDLE, START_TWO, FALSE);
    }
    else if (LANGUAUE_CHN == Func_Mem_Getsystem_Langue())
    {
        Disp_String16x16_CHN(oledbuff, INPUT_PASSWORD_AGAIN_CHN, PAGE_TWO, START_THREE, StringLen(INPUT_PASSWORD_AGAIN_CHN), FALSE);
    }
    Disp_Password_num(oledbuff, NULL, len, PAGE_THREE, TRUE);
    if (len > 0)
    {
        Fill_Block(oledbuff, PAGE_THREE, PAGE_FOUR, START_BASE * (len - 1), START_BASE * ((len < LINE_STRING_MAX) ? (len + 1) : len));
    }
    else
    {
        Fill_AllBlock(oledbuff);//第一次刷整屏
    }
}

void Disp_Opera_ALLUser(uint8_t type)
{
    const uint8_t **words[] = {FINGER_CHN, PASSWORD_CHN, CARD_CHN};
    uint8_t lenbuf[] = {StringLen(FINGER_CHN), StringLen(PASSWORD_CHN), StringLen(CARD_CHN), 0};
    Disp_Input_UserInfo(type, words, "Finger, PWD, Card", lenbuf);
}

void Disp_Opera_Finger_Password(uint8_t type)
{
    const uint8_t **words[] = {FINGER_CHN, PASSWORD_CHN};
    uint8_t lenbuf[] = {StringLen(FINGER_CHN), StringLen(PASSWORD_CHN), 0};
    Disp_Input_UserInfo(type, words, "Finger,PWD", lenbuf);
}

void Disp_Opera_Finger_Card(uint8_t type)
{
    const uint8_t **words[] = {FINGER_CHN, CARD_CHN};
    uint8_t lenbuf[] = {StringLen(FINGER_CHN), StringLen(CARD_CHN), 0};
    Disp_Input_UserInfo(type, words, "Finger,Card", lenbuf);
}

void Disp_Opera_Password_Card(uint8_t type)
{
    const uint8_t **words[] = {PASSWORD_CHN, CARD_CHN};
    uint8_t lenbuf[] = {StringLen(PASSWORD_CHN), StringLen(CARD_CHN), 0};
    Disp_Input_UserInfo(type, words, "PWD,Card", lenbuf);
}

void Disp_Opera_Finger(uint8_t type)
{
    const uint8_t **words[] = {FINGER_CHN};
    uint8_t lenbuf[] = {StringLen(FINGER_CHN), 0};
    Disp_Input_UserInfo(type, words, "Finger", lenbuf);
}

void Disp_Opera_Password(uint8_t type)
{
    const uint8_t **words[] = {PASSWORD_CHN};
    uint8_t lenbuf[] = {StringLen(PASSWORD_CHN), 0};
    Disp_Input_UserInfo(type, words, "PWD", lenbuf);
}

void Disp_Opera_Card(uint8_t type)
{
    const uint8_t **words[] = {CARD_CHN};
    uint8_t lenbuf[] = {StringLen(CARD_CHN), 0};
    Disp_Input_UserInfo(type, words, "Card", lenbuf);
}

void Disp_Menu_First(uint8_t select, uint8_t max)
{
    uint8_t oledbuff[MAX_PAGES][MAX_COLUMN];
    MENU_FIRST_CHN[1] = (Func_Mem_Check_Finger(0)) ? CHANGE_ADMIN_FINGER_CHN : ADD_ADMIN_FINGER_CHN;
    Clear_AllBuff(oledbuff);
    Disp_List(oledbuff, select, max);
    if (LANGUAUE_ENG == Func_Mem_Getsystem_Langue())
    {
        Disp_MenuEng_List(oledbuff, select, max, (char **)MENU_FIRST_ENG);
    }
    else if (LANGUAUE_CHN == Func_Mem_Getsystem_Langue())
    {
        Disp_MenuChn_List(oledbuff, select, max, MENU_FIRST_CHN, Menu_List_First);
    }
    Fill_AllBlock(oledbuff);
}

void Disp_Menu_Delete_Users(uint8_t select, uint8_t max)
{
    uint8_t oledbuff[MAX_PAGES][MAX_COLUMN];
    Clear_AllBuff(oledbuff);
    Disp_List(oledbuff, select, max);
    if (LANGUAUE_ENG == Func_Mem_Getsystem_Langue())
    {
        Disp_MenuEng_List(oledbuff, select, max, (char **)MENU_DELETES_ENG);
    }
    else if (LANGUAUE_CHN == Func_Mem_Getsystem_Langue())
    {
        Disp_MenuChn_List(oledbuff, select, max, MENU_DELETES_CHN, Menu_List_Delete);
    }
    Fill_AllBlock(oledbuff);
}

void Disp_Menu_System_Setting(uint8_t select, uint8_t max)
{
    uint8_t oledbuff[MAX_PAGES][MAX_COLUMN];
    MENU_SYSTEM_SETTING_CHN[0] = (Func_Mem_Getsystem_LockMode()) ? CLOSE_DOUBLE_MODE_CHN : OPEN_DOUBLE_MODE_CHN;
    MENU_SYSTEM_SETTING_CHN[2] = (Func_Mem_Getsystem_AudioMode()) ? SILENT_MODE_CHN : VOICE_MODE_CHN;
    MENU_SYSTEM_SETTING_CHN[3] = (Func_Mem_Getsystem_AlarmMode()) ? CLOSE_ALARM_MODE_CHN : OPEN_ALARM_MODE_CHN;

    MENU_SYSTEM_SETTING_ENG[0] = (Func_Mem_Getsystem_LockMode()) ? CLOSE_DOUBLE_MODE_ENG : OPEN_DOUBLE_MODE_ENG;
    MENU_SYSTEM_SETTING_ENG[2] = (Func_Mem_Getsystem_AudioMode()) ? SILENT_MODE_ENG : VOICE_MODE_ENG;
    MENU_SYSTEM_SETTING_ENG[3] = (Func_Mem_Getsystem_AlarmMode()) ? CLOSE_ALARM_MODE_ENG : OPEN_ALARM_MODE_ENG;

    Clear_AllBuff(oledbuff);
    Disp_List(oledbuff, select, max);
    if (LANGUAUE_ENG == Func_Mem_Getsystem_Langue())
    {
        Disp_MenuEng_List(oledbuff, select, max, (char **)MENU_SYSTEM_SETTING_ENG);
    }
    else if (LANGUAUE_CHN == Func_Mem_Getsystem_Langue())
    {
        Disp_MenuChn_List(oledbuff, select, max, MENU_SYSTEM_SETTING_CHN, Menu_List_System_Setting);
    }
    Fill_AllBlock(oledbuff);
}

void Disp_Menu_Install_Param_Set(uint8_t select, uint8_t max)
{
    uint8_t oledbuff[MAX_PAGES][MAX_COLUMN];

    Clear_AllBuff(oledbuff);
    Disp_List(oledbuff, select, max);
    MENU_INSTALL_PARAM_SET_CHN[0] = (Func_Mem_Getsystem_Motor_Direction()) ? MOTOR_LEFT_CHN : MOTOR_RIGHT_CHN;
    MENU_INSTALL_PARAM_SET_ENG[0] = (Func_Mem_Getsystem_Motor_Direction()) ? MOTOR_LEFT_ENG : MOTOR_RIGHT_ENG;
    if (LANGUAUE_ENG == Func_Mem_Getsystem_Langue())
    {
        Disp_MenuEng_List(oledbuff, select, max, (char **)MENU_INSTALL_PARAM_SET_ENG);
    }
    else if (LANGUAUE_CHN == Func_Mem_Getsystem_Langue())
    {
        Disp_MenuChn_List(oledbuff, select, max, MENU_INSTALL_PARAM_SET_CHN, Menu_List_Install_Param);
    }
    Fill_AllBlock(oledbuff);
}

void Disp_Menu_Net_Config(uint8_t select, uint8_t max)
{
    uint8_t oledbuff[MAX_PAGES][MAX_COLUMN];

    Clear_AllBuff(oledbuff);
    Disp_List(oledbuff, select, max);
    if (LANGUAUE_ENG == Func_Mem_Getsystem_Langue())
    {
        Disp_MenuEng_List(oledbuff, select, max, (char **)MENU_NET_CONFIG_ENG);
    }
    else if (LANGUAUE_CHN == Func_Mem_Getsystem_Langue())
    {
        Disp_MenuChn_List(oledbuff, select, max, MENU_NET_CONFIG_CHN, Menu_List_Net_Config);
    }
    Fill_AllBlock(oledbuff);
}
void Disp_App_Init(void)
{

}

void Disp_Sleep(void)
{
    uint8_t oledbuff[MAX_PAGES][MAX_COLUMN];

    Clear_AllBuff(oledbuff);
    Fill_AllBlock(oledbuff);
}

void Disp_Ctrl(uint32_t time, Func func)
{
    if (time == TRUE)
    {
        func();
    }
    else
    {
        Sys_Callback_ReCreate(&g_LCD_point, time, 0, NULL, func);
    }

}
